pub struct TypeMetadata {
pub name: String,
pub description: String,
pub sections: HashMap<String, Value>,
}Expand description
Generic metadata for a type
Stores arbitrary metadata sections (e.g., “plot”, “format”, “params”, “validate”).
Fields§
§name: StringMeta name (e.g., “Candle”, “Percent”, “ISO8601”)
description: StringHuman-readable description
sections: HashMap<String, Value>Arbitrary metadata sections
Implementations§
Source§impl TypeMetadata
impl TypeMetadata
Sourcepub fn simple(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn simple(name: impl Into<String>, description: impl Into<String>) -> Self
Create a simple metadata item
Sourcepub fn with_section(self, key: impl Into<String>, value: Value) -> Self
pub fn with_section(self, key: impl Into<String>, value: Value) -> Self
Add a metadata section
Sourcepub fn get_section(&self, key: &str) -> Option<&Value>
pub fn get_section(&self, key: &str) -> Option<&Value>
Get a metadata section
Sourcepub fn has_section(&self, key: &str) -> bool
pub fn has_section(&self, key: &str) -> bool
Check if this meta has a specific section
Trait Implementations§
Source§impl Clone for TypeMetadata
impl Clone for TypeMetadata
Source§fn clone(&self) -> TypeMetadata
fn clone(&self) -> TypeMetadata
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 TypeMetadata
impl Debug for TypeMetadata
Source§impl<'de> Deserialize<'de> for TypeMetadata
impl<'de> Deserialize<'de> for TypeMetadata
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 TypeMetadata
impl PartialEq for TypeMetadata
Source§impl Serialize for TypeMetadata
impl Serialize for TypeMetadata
impl StructuralPartialEq for TypeMetadata
Auto Trait Implementations§
impl Freeze for TypeMetadata
impl RefUnwindSafe for TypeMetadata
impl Send for TypeMetadata
impl Sync for TypeMetadata
impl Unpin for TypeMetadata
impl UnsafeUnpin for TypeMetadata
impl UnwindSafe for TypeMetadata
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