#[non_exhaustive]pub enum Action {
Notify,
NotifyInApp,
SetTweak(Tweak),
}Expand description
This represents the different actions that should be taken when a rule is matched, and controls how notifications are delivered to the client.
See the spec for details.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Notify
Causes matching events to generate a notification (both in-app and remote / push).
NotifyInApp
unstable-msc3768 only.Causes matching events to generate an in-app notification but no remote / push notification.
SetTweak(Tweak)
Sets an entry in the ‘tweaks’ dictionary sent to the push gateway.
Implementations§
Source§impl Action
impl Action
Sourcepub fn new(data: CustomActionData) -> Result<Action, Error>
Available on crate feature events only.
pub fn new(data: CustomActionData) -> Result<Action, Error>
events only.Creates a new Action.
Prefer to use the public variants of Action where possible; this constructor is meant
be used for unsupported actions only and does not allow setting arbitrary data for
supported ones.
§Errors
Returns an error if the action type is known and deserialization of data to the
corresponding variant fails.
Sourcepub fn is_highlight(&self) -> bool
Available on crate feature events only.
pub fn is_highlight(&self) -> bool
events only.Whether this action is an Action::SetTweak(Tweak::Highlight(true)).
Sourcepub fn should_notify(&self) -> bool
Available on crate feature events only.
pub fn should_notify(&self) -> bool
events only.Whether this action should trigger a notification (either in-app or remote / push).
Sourcepub fn should_notify_remote(&self) -> bool
Available on crate features events and unstable-msc3768 only.
pub fn should_notify_remote(&self) -> bool
events and unstable-msc3768 only.Whether this action should trigger a remote / push notification.
Sourcepub fn sound(&self) -> Option<&SoundTweakValue>
Available on crate feature events only.
pub fn sound(&self) -> Option<&SoundTweakValue>
events only.The sound that should be played with this action, if any.
Sourcepub fn custom_data(&self) -> Option<&CustomActionData>
Available on crate feature events only.
pub fn custom_data(&self) -> Option<&CustomActionData>
events only.Access the data if this is a custom action.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Action, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Action, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Serialize for Action
impl Serialize for Action
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more