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
A parsed microformat item.
Fields§
§type: Vec<Class>The microformat types (e.g., h-entry, h-card).
properties: PropertiesThe properties of this item.
children: ItemsChild items nested within this item.
id: Option<String>The HTML id attribute of the element.
lang: Option<String>The language of this item.
value: Option<ValueKind>The value property for value-class-pattern items.
Implementations§
Source§impl Item
impl Item
Sourcepub fn remove_whole_property(&mut self, property_name: &str)
pub fn remove_whole_property(&mut self, property_name: &str)
Removes all values for a property.
Sourcepub fn content(&self) -> Option<Vec<PropertyValue>>
pub fn content(&self) -> Option<Vec<PropertyValue>>
Returns the content property values, if any.
Sourcepub fn set_content(&mut self, fragment: Fragment)
pub fn set_content(&mut self, fragment: Fragment)
Sets the content property to a fragment value.
Sourcepub fn append_property(
&mut self,
property_name: &str,
property_value: PropertyValue,
)
pub fn append_property( &mut self, property_name: &str, property_value: PropertyValue, )
Appends a value to a property.
Sourcepub fn has_nested_microformats(&self) -> bool
pub fn has_nested_microformats(&self) -> bool
Returns true if this item contains nested microformats.
Sourcepub fn nested_children(&self) -> Vec<Item>
pub fn nested_children(&self) -> Vec<Item>
Returns nested items from property values.
Sourcepub fn get_property(&self, arg: &str) -> Option<Vec<PropertyValue>>
pub fn get_property(&self, arg: &str) -> Option<Vec<PropertyValue>>
Returns the 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
Source§fn find_items_with_matching_property_value_by<F>(
&self,
predicate: F,
) -> Vec<(String, Item)>
fn find_items_with_matching_property_value_by<F>( &self, predicate: F, ) -> Vec<(String, Item)>
Finds all items with properties matching the predicate.
Source§fn find_items_with_matching_property_value(
&self,
needle: PropertyValue,
) -> Vec<(String, Item)>
fn find_items_with_matching_property_value( &self, needle: PropertyValue, ) -> Vec<(String, Item)>
Finds all items with a property matching the given value.
Source§impl FindItemByUrl for Item
impl FindItemByUrl for Item
Source§impl From<Item> for PropertyValue
impl From<Item> for PropertyValue
Source§impl FromIterator<Item> for Items
impl FromIterator<Item> for Items
Source§impl IntoIterator for Item
impl IntoIterator for Item
Source§impl LanguageFilter for Item
impl LanguageFilter 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 UnsafeUnpin 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.