Enum microformats_types::Class
source · pub enum Class {
Known(KnownClass),
Custom(String),
}
Expand description
Represents a Microformat class. https://microformats.org/wiki/Category:Draft_Specifications
Variants§
Known(KnownClass)
Represents a known Microformat class (h-entry, h-card, etc).
Custom(String)
Represents a class that’s not spec-compliant (h-cookies, h-monster, etc).
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Class
impl<'de> Deserialize<'de> for Class
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<KnownClass> for Class
impl From<KnownClass> for Class
source§fn from(kc: KnownClass) -> Self
fn from(kc: KnownClass) -> Self
Converts to this type from the input type.
source§impl FromStr for Class
impl FromStr for Class
source§fn from_str(class_str: &str) -> Result<Self, Self::Err>
fn from_str(class_str: &str) -> Result<Self, Self::Err>
Parses a string as a Microformat class.
§Examples
assert_eq!(Class::from_str("entry"), Ok(Class::Known(KnownClass::Entry)));
assert_eq!(Class::from_str("h-card"), Ok(Class::Known(KnownClass::Card)));
assert_eq!(Class::from_str("x-plane"), Ok(Class::Custom("x-plane".to_string())));
§type Err = Infallible
type Err = Infallible
The associated error which can be returned from parsing.
source§impl PartialEq for Class
impl PartialEq for Class
source§impl PartialOrd for Class
impl PartialOrd for Class
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Class
Auto Trait Implementations§
impl Freeze for Class
impl RefUnwindSafe for Class
impl Send for Class
impl Sync for Class
impl Unpin for Class
impl UnwindSafe for Class
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