pub struct TypeTable { /* private fields */ }Expand description
Built-in and user-supplied mappings from canonical type path to schema.
Implementations§
Source§impl TypeTable
impl TypeTable
Sourcepub fn builtin() -> Self
pub fn builtin() -> Self
The curated set: std types plus ecosystem types whose serde representation is stable and unambiguous.
Sourcepub fn insert(
&mut self,
path: impl Into<String>,
mapping: impl Into<TypeMapping>,
)
pub fn insert( &mut self, path: impl Into<String>, mapping: impl Into<TypeMapping>, )
Add or override a mapping. User entries win over built-ins, so a crate with a custom serializer for a std type can correct the default.
A bare Value is a literal schema, so existing callers keep working
unchanged; pass a TypeMapping for anything else.
Sourcepub fn lookup(&self, canonical: &str) -> Option<&TypeMapping>
pub fn lookup(&self, canonical: &str) -> Option<&TypeMapping>
Look a canonical path up, accepting the shorter forms users actually
write in config: uuid::Uuid for uuid::Uuid, and the bare type name
when a crate re-exports from a private module.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeTable
impl RefUnwindSafe for TypeTable
impl Send for TypeTable
impl Sync for TypeTable
impl Unpin for TypeTable
impl UnsafeUnpin for TypeTable
impl UnwindSafe for TypeTable
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