pub struct TypeRegistryBuilder { /* private fields */ }Expand description
Builder for TypeRegistry.
Implementations§
Source§impl TypeRegistryBuilder
impl TypeRegistryBuilder
Sourcepub fn insert(self, id: ShapeId<'static>, entry: RegistryEntry) -> Self
pub fn insert(self, id: ShapeId<'static>, entry: RegistryEntry) -> Self
Insert an explicit (ShapeId, RegistryEntry) pair.
Sourcepub fn insert_shape(
self,
schema: &'static Schema<'static>,
deserialize: DeserializeFn,
) -> Self
pub fn insert_shape( self, schema: &'static Schema<'static>, deserialize: DeserializeFn, ) -> Self
Insert a registration derived from a schema and a deserialize function. The shape ID is taken from the schema.
This is the form generated code typically uses.
Sourcepub fn insert_error_shape(
self,
schema: &'static Schema<'static>,
deserialize: DeserializeFn,
error_deserialize: ErrorDeserializeFn,
) -> Self
pub fn insert_error_shape( self, schema: &'static Schema<'static>, deserialize: DeserializeFn, error_deserialize: ErrorDeserializeFn, ) -> Self
Insert a registration for an @error shape, carrying both a type-erased
DeserializeFn and an ErrorDeserializeFn. The shape ID is taken
from the schema.
This is the form generated code uses for error registries; the
ErrorDeserializeFn lets reify_error surface the reified value as
the source of an unhandled error.
Sourcepub fn build(self) -> TypeRegistry
pub fn build(self) -> TypeRegistry
Finalize the builder into a TypeRegistry.
Trait Implementations§
Source§impl Debug for TypeRegistryBuilder
impl Debug for TypeRegistryBuilder
Source§impl Default for TypeRegistryBuilder
impl Default for TypeRegistryBuilder
Source§fn default() -> TypeRegistryBuilder
fn default() -> TypeRegistryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TypeRegistryBuilder
impl !RefUnwindSafe for TypeRegistryBuilder
impl Send for TypeRegistryBuilder
impl Sync for TypeRegistryBuilder
impl Unpin for TypeRegistryBuilder
impl UnsafeUnpin for TypeRegistryBuilder
impl !UnwindSafe for TypeRegistryBuilder
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
§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.