pub struct GameplayEvent<'a> { /* private fields */ }Expand description
High-level view over one SDK gameplay event.
Gameplay payloads share the same typed attribute descriptors as the middle layer but expose dedicated Rust-text helpers for string values.
Implementations§
Source§impl<'a> GameplayEvent<'a>
impl<'a> GameplayEvent<'a>
Sourcepub fn is(self, id: GameplayEventId) -> bool
pub fn is(self, id: GameplayEventId) -> bool
Tests the event against a typed SDK gameplay identifier.
Sourcepub fn get<T: SdkValue>(self, attribute: Attribute<T>) -> Option<T::Decoded<'a>>
pub fn get<T: SdkValue>(self, attribute: Attribute<T>) -> Option<T::Decoded<'a>>
Decodes a scalar typed attribute.
Sourcepub fn get_at<T: SdkValue>(
self,
attribute: Attribute<T>,
index: SdkIndex,
) -> Option<T::Decoded<'a>>
pub fn get_at<T: SdkValue>( self, attribute: Attribute<T>, index: SdkIndex, ) -> Option<T::Decoded<'a>>
Decodes one member of an indexed typed attribute.
Sourcepub fn string(self, attribute: Attribute<StringValue>) -> Option<Cow<'a, str>>
pub fn string(self, attribute: Attribute<StringValue>) -> Option<Cow<'a, str>>
Decodes a string attribute as callback-lifetime Rust text.
Sourcepub fn string_owned(self, attribute: Attribute<StringValue>) -> Option<String>
pub fn string_owned(self, attribute: Attribute<StringValue>) -> Option<String>
Copies a string attribute for storage beyond the current callback.
Sourcepub fn fine_offence(self) -> Option<FineOffence>
pub fn fine_offence(self) -> Option<FineOffence>
Decodes a documented player.fined offence value as a Rust enum.
An absent attribute and a future additive offence both return None.
The generic string accessor preserves the original text when callers
need to distinguish those cases.
Trait Implementations§
Source§impl<'a> Clone for GameplayEvent<'a>
impl<'a> Clone for GameplayEvent<'a>
Source§fn clone(&self) -> GameplayEvent<'a>
fn clone(&self) -> GameplayEvent<'a>
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 moreimpl<'a> Copy for GameplayEvent<'a>
Auto Trait Implementations§
impl<'a> !Send for GameplayEvent<'a>
impl<'a> !Sync for GameplayEvent<'a>
impl<'a> Freeze for GameplayEvent<'a>
impl<'a> RefUnwindSafe for GameplayEvent<'a>
impl<'a> Unpin for GameplayEvent<'a>
impl<'a> UnsafeUnpin for GameplayEvent<'a>
impl<'a> UnwindSafe for GameplayEvent<'a>
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