pub struct BuiltinRegistry { /* private fields */ }Expand description
In-memory registry. Construct with BuiltinRegistry::with_peat_schema_types()
for the default set, then optionally extend with register(…).
Implementations§
Source§impl BuiltinRegistry
impl BuiltinRegistry
Sourcepub fn register(&mut self, desc: TypeDescriptor) -> &mut Self
pub fn register(&mut self, desc: TypeDescriptor) -> &mut Self
Insert a type descriptor. If the descriptor carries a
canonical_collection, the collection→type mapping is also
recorded. Later inserts with the same canonical collection
override earlier ones (last-write-wins).
Sourcepub fn with_peat_schema_types() -> Self
pub fn with_peat_schema_types() -> Self
Registry pre-populated with the peat-schema types that have
validators in crate::validation.
Trait Implementations§
Source§impl Clone for BuiltinRegistry
impl Clone for BuiltinRegistry
Source§fn clone(&self) -> BuiltinRegistry
fn clone(&self) -> BuiltinRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BuiltinRegistry
impl Debug for BuiltinRegistry
Source§impl Default for BuiltinRegistry
impl Default for BuiltinRegistry
Source§fn default() -> BuiltinRegistry
fn default() -> BuiltinRegistry
Returns the “default value” for a type. Read more
Source§impl TypeRegistry for BuiltinRegistry
impl TypeRegistry for BuiltinRegistry
Source§fn for_collection(&self, collection: &str) -> Option<&TypeDescriptor>
fn for_collection(&self, collection: &str) -> Option<&TypeDescriptor>
Look up by conventional collection name (the convention each
TypeDescriptor carries in its canonical_collection field).Auto Trait Implementations§
impl Freeze for BuiltinRegistry
impl RefUnwindSafe for BuiltinRegistry
impl Send for BuiltinRegistry
impl Sync for BuiltinRegistry
impl Unpin for BuiltinRegistry
impl UnsafeUnpin for BuiltinRegistry
impl UnwindSafe for BuiltinRegistry
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