pub enum TaggedPattern {
Any,
Tag {
tag: Tag,
pattern: Box<Pattern>,
},
Name {
name: String,
pattern: Box<Pattern>,
},
Regex {
regex: Regex,
pattern: Box<Pattern>,
},
}
Expand description
Pattern for matching CBOR tagged value structures.
Variants§
Any
Matches any tagged value.
Tag
Matches tagged values with specific tag AND content that matches the pattern.
Name
Regex
Matches tagged values with a tag name that matches the given regex AND content that matches the pattern.
Implementations§
Source§impl TaggedPattern
impl TaggedPattern
Sourcepub fn with_tag(tag: impl Into<Tag>, pattern: Pattern) -> Self
pub fn with_tag(tag: impl Into<Tag>, pattern: Pattern) -> Self
Creates a new TaggedPattern
that matches tagged values with specific
tag AND content that matches the pattern.
Sourcepub fn with_name(name: impl Into<String>, pattern: Pattern) -> Self
pub fn with_name(name: impl Into<String>, pattern: Pattern) -> Self
Creates a new TaggedPattern
that matches tagged values with a tag
having the given name AND content that matches the pattern.
Sourcepub fn with_regex(tag_regex: Regex, pattern: Pattern) -> Self
pub fn with_regex(tag_regex: Regex, pattern: Pattern) -> Self
Creates a new TaggedPattern
that matches tagged values with a tag name
that matches the given regex AND content that matches the pattern.
Trait Implementations§
Source§impl Clone for TaggedPattern
impl Clone for TaggedPattern
Source§fn clone(&self) -> TaggedPattern
fn clone(&self) -> TaggedPattern
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 TaggedPattern
impl Debug for TaggedPattern
Source§impl Display for TaggedPattern
impl Display for TaggedPattern
Source§impl PartialEq for TaggedPattern
impl PartialEq for TaggedPattern
impl Eq for TaggedPattern
Auto Trait Implementations§
impl Freeze for TaggedPattern
impl RefUnwindSafe for TaggedPattern
impl Send for TaggedPattern
impl Sync for TaggedPattern
impl Unpin for TaggedPattern
impl UnwindSafe for TaggedPattern
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