pub struct TimeEventMessage { /* private fields */ }Expand description
A send-safe live time event channel payload.
The dispatch representation is private so local callbacks can never be embedded in a cross-thread message.
Implementations§
Source§impl TimeEventMessage
impl TimeEventMessage
Sourcepub fn new(event: TimeEvent, callback: TimeEventCallback) -> Self
pub fn new(event: TimeEvent, callback: TimeEventCallback) -> Self
Creates a message from a time event and callback.
§Panics
Panics if the process-wide callback ID or lease count is exhausted.
Sourcepub fn dispatch(self) -> bool
pub fn dispatch(self) -> bool
Resolves and runs this message on the receiving thread.
Messages for a RustLocal callback must be dispatched on the thread
where the callback was registered. Dispatching them elsewhere drops
the event and returns false.
Returns true when a callback was dispatched. Cleanup messages and
wrong-thread registered messages return false.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TimeEventMessage
impl !UnwindSafe for TimeEventMessage
impl Freeze for TimeEventMessage
impl Send for TimeEventMessage
impl Sync for TimeEventMessage
impl Unpin for TimeEventMessage
impl UnsafeUnpin for TimeEventMessage
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