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())));
source§type Err = Infallible
type Err = Infallible
The associated error which can be returned from parsing.
source§impl PartialOrd for Class
impl PartialOrd for Class
impl 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)