#[non_exhaustive]pub enum Tweak {
Sound(SoundTweakValue),
Highlight(HighlightTweakValue),
}Expand description
The set_tweak action.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sound(SoundTweakValue)
The sound to be played when this notification arrives.
A device may choose to alert the user by some other means if appropriate, eg. vibration.
Highlight(HighlightTweakValue)
A boolean representing whether or not this message should be highlighted in the UI.
Implementations§
Source§impl Tweak
impl Tweak
Sourcepub fn new(set_tweak: String, value: Option<Box<RawJsonValue>>) -> Result<Self>
pub fn new(set_tweak: String, value: Option<Box<RawJsonValue>>) -> Result<Self>
Creates a new Tweak.
Prefer to use the public variants of Tweak where possible; this constructor is meant
be used for unsupported tweaks only and does not allow setting arbitrary data for
supported ones.
§Errors
Returns an error if the set_tweak is known and deserialization of value to the
corresponding variant fails.
Sourcepub fn custom_value(&self) -> Option<&RawJsonValue>
pub fn custom_value(&self) -> Option<&RawJsonValue>
Access the value, if it is a custom tweak.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tweak
impl<'de> Deserialize<'de> for Tweak
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 From<HighlightTweakValue> for Tweak
impl From<HighlightTweakValue> for Tweak
Source§fn from(value: HighlightTweakValue) -> Self
fn from(value: HighlightTweakValue) -> Self
Converts to this type from the input type.
Source§impl From<SoundTweakValue> for Tweak
impl From<SoundTweakValue> for Tweak
Source§fn from(value: SoundTweakValue) -> Self
fn from(value: SoundTweakValue) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Tweak
impl RefUnwindSafe for Tweak
impl Send for Tweak
impl Sync for Tweak
impl Unpin for Tweak
impl UnsafeUnpin for Tweak
impl UnwindSafe for Tweak
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