pub struct DataCategories(/* private fields */);Expand description
An efficient container for data categories that avoids allocations.
It is a read only and has set like properties, allowing for fast comparisons.
Implementations§
Source§impl DataCategories
impl DataCategories
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates new and empty DataCategories.
Sourcepub fn from_slice(slice: &[DataCategory]) -> Self
pub fn from_slice(slice: &[DataCategory]) -> Self
Creates a new DataCategories from the supplied slice of DataCategory values.
Sourcepub fn add(&self, category: DataCategory) -> Option<Self>
pub fn add(&self, category: DataCategory) -> Option<Self>
Sourcepub fn contains(&self, category: &DataCategory) -> bool
pub fn contains(&self, category: &DataCategory) -> bool
Returns true iff the category is contained.
Sourcepub fn iter(&self) -> DataCategoryIterator ⓘ
pub fn iter(&self) -> DataCategoryIterator ⓘ
Returns an iterator over this DataCategories container.
Trait Implementations§
Source§impl Clone for DataCategories
impl Clone for DataCategories
Source§fn clone(&self) -> DataCategories
fn clone(&self) -> DataCategories
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 DataCategories
impl Debug for DataCategories
Source§impl Default for DataCategories
impl Default for DataCategories
Source§fn default() -> DataCategories
fn default() -> DataCategories
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DataCategories
impl<'de> Deserialize<'de> for DataCategories
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<const N: usize> From<[DataCategory; N]> for DataCategories
impl<const N: usize> From<[DataCategory; N]> for DataCategories
Source§fn from(categories: [DataCategory; N]) -> Self
fn from(categories: [DataCategory; N]) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<SmallVec<[DataCategory; N]>> for DataCategories
impl<const N: usize> From<SmallVec<[DataCategory; N]>> for DataCategories
Source§fn from(categories: SmallVec<[DataCategory; N]>) -> Self
fn from(categories: SmallVec<[DataCategory; N]>) -> Self
Converts to this type from the input type.
Source§impl FromIterator<DataCategory> for DataCategories
impl FromIterator<DataCategory> for DataCategories
Source§fn from_iter<T: IntoIterator<Item = DataCategory>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = DataCategory>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl Hash for DataCategories
impl Hash for DataCategories
Source§impl PartialEq for DataCategories
impl PartialEq for DataCategories
Source§impl Serialize for DataCategories
impl Serialize for DataCategories
impl Copy for DataCategories
impl Eq for DataCategories
impl StructuralPartialEq for DataCategories
Auto Trait Implementations§
impl Freeze for DataCategories
impl RefUnwindSafe for DataCategories
impl Send for DataCategories
impl Sync for DataCategories
impl Unpin for DataCategories
impl UnsafeUnpin for DataCategories
impl UnwindSafe for DataCategories
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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