pub trait GrpcRepr { }Expand description
Marker for “any type that can appear in a gRPC method signature, either
as a parameter or as the success type of Result<T, E> returned from a
method.” Composite shapes (Vec<T>, Option<T>, maps) are
GrpcRepr when their inner type is GrpcReprScalar.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
impl GrpcRepr for String
impl GrpcRepr for bool
impl GrpcRepr for f32
impl GrpcRepr for f64
impl GrpcRepr for i32
impl GrpcRepr for i64
impl GrpcRepr for u32
impl GrpcRepr for u64
impl<T> GrpcRepr for Option<T>where
T: GrpcReprScalar,
Option<T> → optional T (proto3). Disallows Option<Vec<T>> and
Option<HashMap<_,_>> for the same reason maps and lists aren’t scalar.
impl<T> GrpcRepr for Vec<T>where
T: GrpcReprScalar,
Vec<T> → repeated T. Disallows Vec<Vec<T>> because Vec<T> does
not implement GrpcReprScalar.
impl<V, S> GrpcRepr for HashMap<String, V, S>where
V: GrpcReprScalar,
S: BuildHasher,
HashMap<String, V> → map<string, V>. Restricted to string keys —
proto3 also allows integer keys but the common Rust idiom is string
keys, and admitting more would defeat the guard’s clarity.
impl<V> GrpcRepr for BTreeMap<String, V>where
V: GrpcReprScalar,
BTreeMap<String, V> mirrors HashMap<String, V> for code that prefers
deterministic iteration order in serialized output.