Struct microformats_types::Item
source · pub struct Item {
pub type: Vec<Class>,
pub properties: Properties,
pub children: Children,
pub id: Option<String>,
pub lang: Option<String>,
pub value: Option<ValueKind>,
}
Expand description
Represents the structured form of an ‘object’ in Microformats.
Fields§
§type: Vec<Class>
§properties: Properties
Represents the directly associated attributes for this item.
children: Children
Represents a list of children for this item.
id: Option<String>
The ID string of this item, if any is resolved.
lang: Option<String>
The language of this item, if any is resolved.
value: Option<ValueKind>
Represents the precise value of this item (if it’s defined as a property to another).
Implementations§
source§impl Item
impl Item
sourcepub fn new(types: Vec<Class>) -> Self
pub fn new(types: Vec<Class>) -> Self
Creates a new item with the provided ItemParent
as its parent.
pub fn remove_whole_property(&mut self, property_name: &str)
pub fn content(&self) -> Option<Vec<PropertyValue>>
pub fn append_property( &mut self, property_name: &str, property_value: PropertyValue )
sourcepub fn has_nested_microformats(&self) -> bool
pub fn has_nested_microformats(&self) -> bool
Checks if this item has any properties with a nested item.
pub fn nested_children(&self) -> Vec<Item>
sourcepub fn get_property(&self, arg: &str) -> Option<Vec<PropertyValue>>
pub fn get_property(&self, arg: &str) -> Option<Vec<PropertyValue>>
Obtains a list of values for a property.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Item
impl<'de> Deserialize<'de> for Item
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 From<Item> for PropertyValue
impl From<Item> for PropertyValue
source§impl IntoIterator for Item
impl IntoIterator for Item
source§impl PartialEq for Item
impl PartialEq for Item
impl Eq for Item
impl StructuralPartialEq for Item
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl Send for Item
impl Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
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