Struct gigtag::DecodedTags
source · pub struct DecodedTags<F, L, N, V> {
pub tags: Vec<Tag<F, L, N, V>>,
pub undecoded_prefix: String,
}
Expand description
Tags decoded from a text field
Fields§
Valid, decoded tags
undecoded_prefix: String
The remaining, undecoded prefix.
Implementations§
source§impl<F, L, N, V> DecodedTags<F, L, N, V>
impl<F, L, N, V> DecodedTags<F, L, N, V>
sourcepub fn decode_str(encoded: &str) -> Self
pub fn decode_str(encoded: &str) -> Self
Decode from a string slice.
sourcepub fn encode_into<W: Write>(&self, write: &mut W) -> Result
pub fn encode_into<W: Write>(&self, write: &mut W) -> Result
Encode the contents into a separate buffer.
§Errors
Returns an fmt::Error
if writing into the buffer fails.
sourcepub fn reorder_and_dedup(&mut self)
pub fn reorder_and_dedup(&mut self)
Reorder and deduplicate tags.
Canonical ordering:
- Tags without a facet
- Tags with a non-date-like facet
- Tags with a date-like facet (by descending suffix)
Within each group tags are sorted by facet, then by label. For tags with equal facets those with a label are sorted before those without a label.
Tags with a date-like facet are sorted in descending order by their date-like suffix, i.e. newer dates are sorted before older dates.
Trait Implementations§
source§impl<F: Clone, L: Clone, N: Clone, V: Clone> Clone for DecodedTags<F, L, N, V>
impl<F: Clone, L: Clone, N: Clone, V: Clone> Clone for DecodedTags<F, L, N, V>
source§fn clone(&self) -> DecodedTags<F, L, N, V>
fn clone(&self) -> DecodedTags<F, L, N, V>
Returns a copy 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<F: PartialEq, L: PartialEq, N: PartialEq, V: PartialEq> PartialEq for DecodedTags<F, L, N, V>
impl<F: PartialEq, L: PartialEq, N: PartialEq, V: PartialEq> PartialEq for DecodedTags<F, L, N, V>
source§fn eq(&self, other: &DecodedTags<F, L, N, V>) -> bool
fn eq(&self, other: &DecodedTags<F, L, N, V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<F: Eq, L: Eq, N: Eq, V: Eq> Eq for DecodedTags<F, L, N, V>
impl<F, L, N, V> StructuralPartialEq for DecodedTags<F, L, N, V>
Auto Trait Implementations§
impl<F, L, N, V> RefUnwindSafe for DecodedTags<F, L, N, V>
impl<F, L, N, V> Send for DecodedTags<F, L, N, V>
impl<F, L, N, V> Sync for DecodedTags<F, L, N, V>
impl<F, L, N, V> Unpin for DecodedTags<F, L, N, V>
impl<F, L, N, V> UnwindSafe for DecodedTags<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