Skip to main content

GrpcRepr

Trait GrpcRepr 

Source
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§

Source§

impl GrpcRepr for String

Source§

impl GrpcRepr for bool

Source§

impl GrpcRepr for f32

Source§

impl GrpcRepr for f64

Source§

impl GrpcRepr for i32

Source§

impl GrpcRepr for i64

Source§

impl GrpcRepr for u32

Source§

impl GrpcRepr for u64

Source§

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.

Source§

impl<T> GrpcRepr for Vec<T>
where T: GrpcReprScalar,

Vec<T> → repeated T. Disallows Vec<Vec<T>> because Vec<T> does not implement GrpcReprScalar.

Source§

impl<V, S> GrpcRepr for HashMap<String, V, S>

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.

Source§

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.

Implementors§