pub struct OwnedGameEvent<'s> { /* private fields */ }Expand description
A game event this plugin created, which is freed when dropped unless fired.
Implementations§
Source§impl<'s> OwnedGameEvent<'s>
impl<'s> OwnedGameEvent<'s>
Sourcepub fn as_event_mut(&mut self) -> GameEventMut<'_>
pub fn as_event_mut(&mut self) -> GameEventMut<'_>
Edits the event through a handle, which cannot outlive this owner.
Sourcepub fn fire(self, broadcast: bool) -> Result<(), FireEventError>
pub fn fire(self, broadcast: bool) -> Result<(), FireEventError>
Delivers the event to every listener, and to clients if broadcast is set.
Listeners run synchronously, so this may run arbitrary game and plugin code, including this plugin’s own listeners. Fails if the manager reports that it did not fire the event, which the engine frees either way.
Sourcepub fn set_string(&mut self, key: &CStr, value: &CStr)
pub fn set_string(&mut self, key: &CStr, value: &CStr)
Sets a string value for key. The event stores a copy of value.
Sourcepub fn set_uint64(&mut self, key: &CStr, value: u64)
pub fn set_uint64(&mut self, key: &CStr, value: u64)
Sets a 64-bit value for key.
Trait Implementations§
Source§impl<'s> Debug for OwnedGameEvent<'s>
impl<'s> Debug for OwnedGameEvent<'s>
Source§impl Drop for OwnedGameEvent<'_>
impl Drop for OwnedGameEvent<'_>
Auto Trait Implementations§
impl<'s> !Send for OwnedGameEvent<'s>
impl<'s> !Sync for OwnedGameEvent<'s>
impl<'s> Freeze for OwnedGameEvent<'s>
impl<'s> RefUnwindSafe for OwnedGameEvent<'s>
impl<'s> Unpin for OwnedGameEvent<'s>
impl<'s> UnsafeUnpin for OwnedGameEvent<'s>
impl<'s> UnwindSafe for OwnedGameEvent<'s>
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