Struct hedwig::validators::prost::ExactSchemaMatcher [−][src]
pub struct ExactSchemaMatcher<T> { /* fields omitted */ }
This is supported on crate feature
prost
only.Expand description
A SchemaMatcher
which expects all incoming schemas to match exactly one string for the
given message type
use hedwig::validators::prost::{ExactSchemaMatcher, SchemaMatcher, SchemaMismatchError};
struct MyMessage {
// ...
}
let schema = "messages/my-message/my-schema-v1.proto";
let my_matcher = ExactSchemaMatcher::<MyMessage>::new(schema);
assert_eq!(Ok(()), my_matcher.try_match_schema(schema));
let bad_schema = "messages/my-message/my-schema-v2.proto";
assert_eq!(
Err(SchemaMismatchError::new::<MyMessage>(
schema,
bad_schema.to_owned()
)),
my_matcher.try_match_schema(bad_schema)
);
Implementations
Trait Implementations
This is supported on crate feature
prost
only.The error returned when a given schema does not match the message type
This is supported on crate feature
prost
only.Check whether messages with the given schema are valid for deserializing into the trait’s generic message type. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for ExactSchemaMatcher<T>
impl<T> Send for ExactSchemaMatcher<T>
impl<T> Sync for ExactSchemaMatcher<T>
impl<T> Unpin for ExactSchemaMatcher<T>
impl<T> UnwindSafe for ExactSchemaMatcher<T>
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more