#[non_exhaustive]pub struct Restriction {
pub namespace: String,
pub allow_list: Vec<String>,
pub deny_list: Vec<String>,
/* private fields */
}Expand description
Restriction of a datapoint which describe its attributes(tokens) from each of several attribute categories(namespaces).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.namespace: StringThe namespace of this restriction. e.g.: color.
allow_list: Vec<String>The attributes to allow in this namespace. e.g.: ‘red’
deny_list: Vec<String>The attributes to deny in this namespace. e.g.: ‘blue’
Implementations§
Source§impl Restriction
impl Restriction
pub fn new() -> Self
Sourcepub fn set_namespace<T: Into<String>>(self, v: T) -> Self
pub fn set_namespace<T: Into<String>>(self, v: T) -> Self
Sets the value of namespace.
Sourcepub fn set_allow_list<T, V>(self, v: T) -> Self
pub fn set_allow_list<T, V>(self, v: T) -> Self
Sets the value of allow_list.
Sourcepub fn set_deny_list<T, V>(self, v: T) -> Self
pub fn set_deny_list<T, V>(self, v: T) -> Self
Sets the value of deny_list.
Trait Implementations§
Source§impl Clone for Restriction
impl Clone for Restriction
Source§fn clone(&self) -> Restriction
fn clone(&self) -> Restriction
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 Debug for Restriction
impl Debug for Restriction
Source§impl Default for Restriction
impl Default for Restriction
Source§fn default() -> Restriction
fn default() -> Restriction
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Restrictionwhere
Restriction: Default,
impl<'de> Deserialize<'de> for Restrictionwhere
Restriction: Default,
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 Message for Restriction
impl Message for Restriction
Source§impl PartialEq for Restriction
impl PartialEq for Restriction
Source§impl Serialize for Restriction
impl Serialize for Restriction
impl StructuralPartialEq for Restriction
Auto Trait Implementations§
impl Freeze for Restriction
impl RefUnwindSafe for Restriction
impl Send for Restriction
impl Sync for Restriction
impl Unpin for Restriction
impl UnwindSafe for Restriction
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