pub struct TagComponent(/* private fields */);Expand description
Represents both tag names and values (see TagName & TagValue).
See the TagComponent::from associated method for information on what
constitutes a valid tag name/value.
Implementations§
Source§impl TagComponent
impl TagComponent
Sourcepub fn from<S: ToString>(value: &S) -> Result<Self, TagError>
pub fn from<S: ToString>(value: &S) -> Result<Self, TagError>
Create a TagComponent, or return a TagError
First the input string is converted to lowercase and leading and trailing whitespace is removed
What is left:
- Must only contain lowercase ASCII letters or
-s - Must not start with
- - Must not end with
- - Must not contain consecutive hyphens
§Valid inputs
My-tagtag-component-here
§Invalid inputs
-my-taganother-tag-tag--component
Trait Implementations§
Source§impl Clone for TagComponent
impl Clone for TagComponent
Source§fn clone(&self) -> TagComponent
fn clone(&self) -> TagComponent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TagComponent
impl Debug for TagComponent
Source§impl<'de> Deserialize<'de> for TagComponent
impl<'de> Deserialize<'de> for TagComponent
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 Display for TagComponent
impl Display for TagComponent
Source§impl Hash for TagComponent
impl Hash for TagComponent
Source§impl Ord for TagComponent
impl Ord for TagComponent
Source§fn cmp(&self, other: &TagComponent) -> Ordering
fn cmp(&self, other: &TagComponent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TagComponent
impl PartialEq for TagComponent
Source§impl PartialOrd for TagComponent
impl PartialOrd for TagComponent
Source§impl Serialize for TagComponent
impl Serialize for TagComponent
impl Eq for TagComponent
impl StructuralPartialEq for TagComponent
Auto Trait Implementations§
impl Freeze for TagComponent
impl RefUnwindSafe for TagComponent
impl Send for TagComponent
impl Sync for TagComponent
impl Unpin for TagComponent
impl UnwindSafe for TagComponent
Blanket Implementations§
Source§impl<T> BoolTagExprLexicalParse for Twhere
T: ToString,
impl<T> BoolTagExprLexicalParse for Twhere
T: ToString,
Source§fn lexical_parse(self) -> Result<LexicalTokenStream, ParseError>
fn lexical_parse(self) -> Result<LexicalTokenStream, ParseError>
Lexically parse value
Source§impl<T> BoolTagExprSyntaxParse<T> for Twhere
T: BoolTagExprLexicalParse,
impl<T> BoolTagExprSyntaxParse<T> for Twhere
T: BoolTagExprLexicalParse,
Source§fn syntax_parse(self) -> Result<BoolTagExpr, ParseError>
fn syntax_parse(self) -> Result<BoolTagExpr, ParseError>
Lexically and then syntactically parse the value into a boolean
expression tree
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