pub struct LabelValueDefinition<S: BosStr = DefaultStr> {
pub adult_only: Option<bool>,
pub blurs: LabelValueDefinitionBlurs<S>,
pub default_setting: Option<LabelValueDefinitionDefaultSetting<S>>,
pub identifier: S,
pub locales: Vec<LabelValueDefinitionStrings<S>>,
pub severity: LabelValueDefinitionSeverity<S>,
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}Expand description
Declares a label value and its expected interpretations and behaviors.
Fields§
§adult_only: Option<bool>Does the user need to have adult content enabled in order to configure this label?
blurs: LabelValueDefinitionBlurs<S>What should this label hide in the UI, if applied? ‘content’ hides all of the target; ‘media’ hides the images/video/audio; ‘none’ hides nothing.
default_setting: Option<LabelValueDefinitionDefaultSetting<S>>The default setting for this label.
identifier: SThe value of the label being defined. Must only include lowercase ascii and the ‘-’ character ([a-z-]+).
locales: Vec<LabelValueDefinitionStrings<S>>§severity: LabelValueDefinitionSeverity<S>How should a client visually convey this label? ‘inform’ means neutral and informational; ‘alert’ means negative and warning; ‘none’ means show nothing.
extra_data: Option<BTreeMap<SmolStr, Data<S>>>Implementations§
Source§impl LabelValueDefinition<DefaultStr>
impl LabelValueDefinition<DefaultStr>
Sourcepub fn new() -> LabelValueDefinitionBuilder<Empty, DefaultStr>
pub fn new() -> LabelValueDefinitionBuilder<Empty, DefaultStr>
Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
Source§impl<S: BosStr> LabelValueDefinition<S>
impl<S: BosStr> LabelValueDefinition<S>
Sourcepub fn builder() -> LabelValueDefinitionBuilder<Empty, S>
pub fn builder() -> LabelValueDefinitionBuilder<Empty, S>
Create a new builder for this type
Trait Implementations§
Source§impl<S: Clone + BosStr> Clone for LabelValueDefinition<S>
impl<S: Clone + BosStr> Clone for LabelValueDefinition<S>
Source§fn clone(&self) -> LabelValueDefinition<S>
fn clone(&self) -> LabelValueDefinition<S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, S> Deserialize<'de> for LabelValueDefinition<S>where
S: Deserialize<'de> + BosStr,
impl<'de, S> Deserialize<'de> for LabelValueDefinition<S>where
S: Deserialize<'de> + BosStr,
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
impl<S: Eq + BosStr> Eq for LabelValueDefinition<S>
Source§impl<S: BosStr + IntoStatic> IntoStatic for LabelValueDefinition<S>
impl<S: BosStr + IntoStatic> IntoStatic for LabelValueDefinition<S>
Source§type Output = LabelValueDefinition<<S as IntoStatic>::Output>
type Output = LabelValueDefinition<<S as IntoStatic>::Output>
The “owned” variant of the type. For
Cow<'a, str>, this is Cow<'static, str>, for example.Source§fn into_static(self) -> Self::Output
fn into_static(self) -> Self::Output
Turns the value into an “owned” variant, which can then be returned, moved, etc. Read more
Source§impl<S: BosStr> LexiconSchema for LabelValueDefinition<S>
impl<S: BosStr> LexiconSchema for LabelValueDefinition<S>
Source§fn lexicon_doc() -> LexiconDoc<'static>
fn lexicon_doc() -> LexiconDoc<'static>
Generate the lexicon document for this type Read more
Source§fn validate(&self) -> Result<(), ConstraintError>
fn validate(&self) -> Result<(), ConstraintError>
Validate an instance against lexicon constraints Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether this type should be inlined vs referenced Read more
Source§impl<S: PartialEq + BosStr> PartialEq for LabelValueDefinition<S>
impl<S: PartialEq + BosStr> PartialEq for LabelValueDefinition<S>
Source§fn eq(&self, other: &LabelValueDefinition<S>) -> bool
fn eq(&self, other: &LabelValueDefinition<S>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<S> Serialize for LabelValueDefinition<S>
impl<S> Serialize for LabelValueDefinition<S>
impl<S: BosStr> StructuralPartialEq for LabelValueDefinition<S>
Auto Trait Implementations§
impl<S> Freeze for LabelValueDefinition<S>where
S: Freeze,
impl<S> RefUnwindSafe for LabelValueDefinition<S>where
S: RefUnwindSafe,
impl<S> Send for LabelValueDefinition<S>where
S: Send,
impl<S> Sync for LabelValueDefinition<S>where
S: Sync,
impl<S> Unpin for LabelValueDefinition<S>where
S: Unpin,
impl<S> UnsafeUnpin for LabelValueDefinition<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for LabelValueDefinition<S>where
S: UnwindSafe + RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.