pub struct Tag<F, L, N, V> {
pub label: L,
pub facet: F,
pub props: Vec<Property<N, V>>,
}
Expand description
A tag
Fields§
§label: L
The label
facet: F
The facet
props: Vec<Property<N, V>>
The properties
Implementations§
source§impl<F, L, N, V> Tag<F, L, N, V>
impl<F, L, N, V> Tag<F, L, N, V>
sourcepub fn encode_into<W: Write>(&self, write: &mut W) -> Result
pub fn encode_into<W: Write>(&self, write: &mut W) -> Result
Encode a tag as a string.
The tag must be valid.
§Errors
Returns an fmt::Error
if writing into the buffer fails.
source§impl<F, L, N, V> Tag<F, L, N, V>
impl<F, L, N, V> Tag<F, L, N, V>
sourcepub fn decode_str(encoded: &str) -> Result<Self, DecodeError>
pub fn decode_str(encoded: &str) -> Result<Self, DecodeError>
Decode a tag from an encoded token.
The encoded
input must not contain any leading/trailing whitespace.
The caller is responsible to ensure that no leading/trailing whitespace
is present if decoding should not fail because of this. Separating
whitespace between tokens should already be discarded when tokenizing
the input text.
§Errors
Returns a DecodeError
if the encoded input cannot be decoded as a valid tag.
Trait Implementations§
source§impl<F: PartialEq, L: PartialEq, N: PartialEq, V: PartialEq> PartialEq for Tag<F, L, N, V>
impl<F: PartialEq, L: PartialEq, N: PartialEq, V: PartialEq> PartialEq for Tag<F, L, N, V>
impl<F: Eq, L: Eq, N: Eq, V: Eq> Eq for Tag<F, L, N, V>
impl<F, L, N, V> StructuralPartialEq for Tag<F, L, N, V>
Auto Trait Implementations§
impl<F, L, N, V> RefUnwindSafe for Tag<F, L, N, V>
impl<F, L, N, V> Send for Tag<F, L, N, V>
impl<F, L, N, V> Sync for Tag<F, L, N, V>
impl<F, L, N, V> Unpin for Tag<F, L, N, V>
impl<F, L, N, V> UnwindSafe for Tag<F, L, N, V>
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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
source§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString
. Read more