https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-father-404

01/26/2021, 9:39 PM
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

hundreds-breakfast-49010

01/26/2021, 9:45 PM
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

hundreds-father-404

01/26/2021, 9:46 PM
Cool, that sounds much more generalizable, say, if we stop using Tonic in the future. Thanks!