Code style question: how much pre-processing do we...
# development
h
Code style question: how much pre-processing do we want to do on the FFI boundary? We duplicate in 3 places converting the BTreeMap for remote headers into a
tonic::MetadataMap
, and then into
tonic::Interceptor
I want to factor that up into
<http://context.rs|context.rs>::RemoteOptions
, but am not sure how "pure" we want to keep that FFI boundary. Two options: 1. Store
MetadataMap
directly on
RemoteOptions
instead of
BTreeMap
2. Add a method to
RemoteOptions
to convert the
BTreeMap
into
MetadataMap
#2 feels more right to me
h
I would say it makes sense to define a method to convert from a type we use to a type a specific external library uses, rather than incorporation that external library's type into our own core code
so go with #2
h
Cool, that sounds much more generalizable, say, if we stop using Tonic in the future. Thanks!