pub struct SchemaStore { /* private fields */ }Expand description
Per-producer schema sets, fetched lazily and cached for the process.
Implementations§
Source§impl SchemaStore
impl SchemaStore
pub fn new(base: impl Into<String>, timeout: Duration) -> Self
Sourcepub fn decoders_mut(&mut self) -> &mut DecoderRegistry
pub fn decoders_mut(&mut self) -> &mut DecoderRegistry
The decoder table (register custom kinds through this).
Sourcepub async fn schema_for(
&self,
session: &Session,
producer: &str,
type_name: &str,
) -> Option<TypeSchema>
pub async fn schema_for( &self, session: &Session, producer: &str, type_name: &str, ) -> Option<TypeSchema>
The schema for type_name as served by producer, fetching
@rpc/<producer>/describe on first miss. None = the producer does
not serve describe or does not describe this type — render
structurally (never an error; RFC 08 §7 is a SHOULD for
self-describing encodings).
Sourcepub fn decode(
&self,
schema: &TypeSchema,
encoding: &WireEncoding,
bytes: &[u8],
) -> Result<DecodedPayload, DecodeError>
pub fn decode( &self, schema: &TypeSchema, encoding: &WireEncoding, bytes: &[u8], ) -> Result<DecodedPayload, DecodeError>
Decode bytes under a schema, if one resolves.
Auto Trait Implementations§
impl !Freeze for SchemaStore
impl !RefUnwindSafe for SchemaStore
impl !UnwindSafe for SchemaStore
impl Send for SchemaStore
impl Sync for SchemaStore
impl Unpin for SchemaStore
impl UnsafeUnpin for SchemaStore
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more