pub struct Tags(/* private fields */);Expand description
Tags.
Implementations§
Source§impl Tags
impl Tags
pub fn new() -> Self
pub fn merge(a: Self, b: Self) -> Self
Sourcepub fn extend(&mut self, tags: impl IntoIterator<Item = Tag>)
pub fn extend(&mut self, tags: impl IntoIterator<Item = Tag>)
Insert mutiple tags.
Tags that equal exactly (key and value) will be skipped. All others will be added.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Contains tag with key.
Sourcepub fn set(&mut self, tags: impl Into<Tags>)
pub fn set(&mut self, tags: impl Into<Tags>)
Set tag(s). By removing all tags with the same key before insert.
Sourcepub fn clear(&mut self, tags: Option<&Tags>) -> bool
pub fn clear(&mut self, tags: Option<&Tags>) -> bool
Remove specified tags.
If no tags are specified all tags will be removed.
Returns true if tags has changed.
Sourcepub fn clear_key(&mut self, key: &str)
pub fn clear_key(&mut self, key: &str)
Remove tags with key. If no tags are specified all tags will be removed.
pub fn matches<P: TagPattern>(&self, pattern: &P) -> bool
Sourcepub fn string(&self, key: &str) -> Option<&str>
pub fn string(&self, key: &str) -> Option<&str>
Get first tag value (that is a string) for given key.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tags
impl<'de> Deserialize<'de> for Tags
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 IntoIterator for Tags
impl IntoIterator for Tags
Source§impl JsonSchema for Tags
impl JsonSchema for Tags
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Tags
impl Ord for Tags
Source§impl PartialOrd for Tags
impl PartialOrd for Tags
Source§impl TagMatcher for Tags
impl TagMatcher for Tags
Source§impl TagPattern for Tags
impl TagPattern for Tags
fn matches_pattern<M: TagMatcher>(&self, matcher: &M) -> bool
impl Eq for Tags
impl StructuralPartialEq for Tags
Auto Trait Implementations§
impl Freeze for Tags
impl RefUnwindSafe for Tags
impl Send for Tags
impl Sync for Tags
impl Unpin for Tags
impl UnsafeUnpin for Tags
impl UnwindSafe for Tags
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more