pub trait UpdateEvent: Sized {
// Required methods
fn from_update_args(args: &UpdateArgs, old_event: &Self) -> Option<Self>;
fn update<U, F>(&self, f: F) -> Option<U>
where F: FnMut(&UpdateArgs) -> U;
// Provided methods
fn from_dt(dt: f64, old_event: &Self) -> Option<Self> { ... }
fn update_args(&self) -> Option<UpdateArgs> { ... }
}
Expand description
When the application state should be updated.
Required Methods§
Sourcefn from_update_args(args: &UpdateArgs, old_event: &Self) -> Option<Self>
fn from_update_args(args: &UpdateArgs, old_event: &Self) -> Option<Self>
Creates an update event.
Sourcefn update<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&UpdateArgs) -> U,
fn update<U, F>(&self, f: F) -> Option<U>where
F: FnMut(&UpdateArgs) -> U,
Calls closure if this is an update event.
Provided Methods§
Sourcefn update_args(&self) -> Option<UpdateArgs>
fn update_args(&self) -> Option<UpdateArgs>
Returns update arguments.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.