pub struct TypeRegistry {
pub items: Vec<TypeMetadata>,
pub default_item: String,
}Expand description
Registry of available metadata/formats for a type
Fields§
§items: Vec<TypeMetadata>Available metadata items
default_item: StringName of the default item
Implementations§
Source§impl TypeRegistry
impl TypeRegistry
Sourcepub fn new(default_item: impl Into<String>) -> Self
pub fn new(default_item: impl Into<String>) -> Self
Create an empty registry with a default item
Sourcepub fn with_item(self, item: TypeMetadata) -> Self
pub fn with_item(self, item: TypeMetadata) -> Self
Add a metadata item
Sourcepub fn default_for_primitives() -> Self
pub fn default_for_primitives() -> Self
Create a default registry for basic types (JSON-like display)
Sourcepub fn for_number() -> Self
pub fn for_number() -> Self
Create a registry for number types
Sourcepub fn for_timestamp() -> Self
pub fn for_timestamp() -> Self
Create a registry for timestamp types
Trait Implementations§
Source§impl Clone for TypeRegistry
impl Clone for TypeRegistry
Source§fn clone(&self) -> TypeRegistry
fn clone(&self) -> TypeRegistry
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 TypeRegistry
impl Debug for TypeRegistry
Source§impl<'de> Deserialize<'de> for TypeRegistry
impl<'de> Deserialize<'de> for TypeRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TypeRegistry
impl PartialEq for TypeRegistry
Source§impl Serialize for TypeRegistry
impl Serialize for TypeRegistry
impl StructuralPartialEq for TypeRegistry
Auto Trait Implementations§
impl Freeze for TypeRegistry
impl RefUnwindSafe for TypeRegistry
impl Send for TypeRegistry
impl Sync for TypeRegistry
impl Unpin for TypeRegistry
impl UnsafeUnpin for TypeRegistry
impl UnwindSafe for TypeRegistry
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