#[non_exhaustive]pub struct GlobalEvent {
pub ts: Option<DateTime>,
pub kind: Option<GlobalEventKind>,
pub notification: Option<GlobalEventNotification>,
}Expand description
An event relevant to the current identity.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ts: Option<DateTime>RFC3339 timestamp.
kind: Option<GlobalEventKind>Kind of event that occured.
notification: Option<GlobalEventNotification>Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open url in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use rivet.api.identity.common#GlobalEvent$kind to determine what action to take when the notification is interacted with. For example, if the global event kind is rivet.api.identity.common#GlobalEventChatMessage, then open the chat UI for the given thread.
Implementations§
Source§impl GlobalEvent
impl GlobalEvent
Sourcepub fn kind(&self) -> Option<&GlobalEventKind>
pub fn kind(&self) -> Option<&GlobalEventKind>
Kind of event that occured.
Sourcepub fn notification(&self) -> Option<&GlobalEventNotification>
pub fn notification(&self) -> Option<&GlobalEventNotification>
Notifications represent information that should be presented to the user immediately. At the moment, only chat message events have associated notifications. # Display Notifications should be displayed in an unobtrusive manner throughout the entire game. Notifications should disappear after a few seconds if not interacted with. # Interactions If your platform supports it, notifications should be able to be clicked or tapped in order to open the relevant context for the event. For a simple implementation of notification interactions, open url in a web browser to present the relevant context. For example, a chat message notification will open the thread the chat message was sent in. For advanced implementations that implement a custom chat UI, use rivet.api.identity.common#GlobalEvent$kind to determine what action to take when the notification is interacted with. For example, if the global event kind is rivet.api.identity.common#GlobalEventChatMessage, then open the chat UI for the given thread.
Source§impl GlobalEvent
impl GlobalEvent
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture GlobalEvent
Trait Implementations§
Source§impl Clone for GlobalEvent
impl Clone for GlobalEvent
Source§fn clone(&self) -> GlobalEvent
fn clone(&self) -> GlobalEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GlobalEvent
impl Debug for GlobalEvent
Source§impl PartialEq for GlobalEvent
impl PartialEq for GlobalEvent
Source§fn eq(&self, other: &GlobalEvent) -> bool
fn eq(&self, other: &GlobalEvent) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GlobalEvent
Auto Trait Implementations§
impl Freeze for GlobalEvent
impl RefUnwindSafe for GlobalEvent
impl Send for GlobalEvent
impl Sync for GlobalEvent
impl Unpin for GlobalEvent
impl UnsafeUnpin for GlobalEvent
impl UnwindSafe for GlobalEvent
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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