pub struct RegistryEntry { /* private fields */ }Expand description
A single entry in a TypeRegistry, pairing a shape’s Schema
with a DeserializeFn that constructs the typed value.
Error-registry entries additionally carry an ErrorDeserializeFn so the
reified value can be surfaced as the source of an unhandled error; see
reify_error.
Implementations§
Source§impl RegistryEntry
impl RegistryEntry
Sourcepub const fn new(
schema: &'static Schema<'static>,
deserialize: DeserializeFn,
) -> Self
pub const fn new( schema: &'static Schema<'static>, deserialize: DeserializeFn, ) -> Self
Build a RegistryEntry from a static schema reference and a
type-erased deserialize function.
Sourcepub const fn new_error(
schema: &'static Schema<'static>,
deserialize: DeserializeFn,
error_deserialize: ErrorDeserializeFn,
) -> Self
pub const fn new_error( schema: &'static Schema<'static>, deserialize: DeserializeFn, error_deserialize: ErrorDeserializeFn, ) -> Self
Build a RegistryEntry for an @error shape, carrying both a
type-erased DeserializeFn and an ErrorDeserializeFn that boxes
the reified value as a dyn std::error::Error.
Sourcepub fn deserialize_fn(&self) -> DeserializeFn
pub fn deserialize_fn(&self) -> DeserializeFn
The type-erased deserialize function for this entry.
Sourcepub fn error_deserialize_fn(&self) -> Option<ErrorDeserializeFn>
pub fn error_deserialize_fn(&self) -> Option<ErrorDeserializeFn>
The error deserialize function for this entry, if it was registered as
an @error shape.
Trait Implementations§
Source§impl Clone for RegistryEntry
impl Clone for RegistryEntry
Source§fn clone(&self) -> RegistryEntry
fn clone(&self) -> RegistryEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegistryEntry
impl Debug for RegistryEntry
impl Copy for RegistryEntry
Auto Trait Implementations§
impl Freeze for RegistryEntry
impl !RefUnwindSafe for RegistryEntry
impl Send for RegistryEntry
impl Sync for RegistryEntry
impl Unpin for RegistryEntry
impl UnsafeUnpin for RegistryEntry
impl !UnwindSafe for RegistryEntry
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.