pub struct Item {
pub type: Vec<Class>,
pub properties: Properties,
pub children: Items,
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: Items
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 FindItemById for Item
impl FindItemById for Item
Source§impl FindItemByProperty for Item
impl FindItemByProperty for Item
fn find_items_with_matching_property_value_by<F>( &self, predicate: F, ) -> Vec<(String, Item)>
fn find_items_with_matching_property_value( &self, needle: PropertyValue, ) -> Vec<(String, Item)>
Source§impl FindItemByUrl for Item
impl FindItemByUrl for Item
Source§impl From<Item> for PropertyValue
impl From<Item> for PropertyValue
Source§impl IntoIterator for Item
impl IntoIterator 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.