pub struct SequenceSet(/* private fields */);Expand description
A validated IMAP sequence-set string.
RFC 3501 Section 9 formal syntax:
sequence-set = (seq-number / seq-range) *("," sequence-set)
seq-number = nz-number / "*"
seq-range = seq-number ":" seq-number
nz-number = digit-nz *DIGIT ; non-zero unsigned 32-bit integerRFC 5182 Section 5 extends the grammar with "$" as a standalone
element referencing saved search results.
Construction validates the full ABNF and rejects empty, malformed, or overflowing values.
Implementations§
Source§impl SequenceSet
impl SequenceSet
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes the wrapper and returns the inner string.
Sourcepub fn new(s: impl Into<String>) -> Result<Self, ValidationError>
pub fn new(s: impl Into<String>) -> Result<Self, ValidationError>
Create a general sequence set (allows * and $).
Validates the input against RFC 3501 Section 9 sequence-set ABNF,
extended by RFC 5182 Section 5 for $.
Sourcepub fn new_known(s: impl Into<String>) -> Result<Self, ValidationError>
pub fn new_known(s: impl Into<String>) -> Result<Self, ValidationError>
Create a “known” sequence set that rejects * and $.
Used for QRESYNC known-uids and seq-match-data where the
wildcard * is explicitly disallowed (RFC 7162 Section 3.2.5.2)
and $ (RFC 5182 search result reference) is not meaningful.
Trait Implementations§
Source§impl AsRef<str> for SequenceSet
impl AsRef<str> for SequenceSet
Source§impl Clone for SequenceSet
impl Clone for SequenceSet
Source§fn clone(&self) -> SequenceSet
fn clone(&self) -> SequenceSet
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 SequenceSet
impl Debug for SequenceSet
Source§impl Display for SequenceSet
impl Display for SequenceSet
Source§impl From<SequenceSet> for String
impl From<SequenceSet> for String
Source§fn from(s: SequenceSet) -> Self
fn from(s: SequenceSet) -> Self
Converts to this type from the input type.
Source§impl Hash for SequenceSet
impl Hash for SequenceSet
Source§impl PartialEq for SequenceSet
impl PartialEq for SequenceSet
Source§impl TryFrom<&str> for SequenceSet
impl TryFrom<&str> for SequenceSet
Source§impl TryFrom<String> for SequenceSet
impl TryFrom<String> for SequenceSet
impl Eq for SequenceSet
impl StructuralPartialEq for SequenceSet
Auto Trait Implementations§
impl Freeze for SequenceSet
impl RefUnwindSafe for SequenceSet
impl Send for SequenceSet
impl Sync for SequenceSet
impl Unpin for SequenceSet
impl UnsafeUnpin for SequenceSet
impl UnwindSafe for SequenceSet
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