pub struct Cmd<MSG> { /* private fields */ }
Expand description
Cmd is a way to tell the Runtime that something needs to be executed
Implementations§
Source§impl<MSG> Cmd<MSG>where
MSG: 'static,
impl<MSG> Cmd<MSG>where
MSG: 'static,
Sourcepub fn once<F>(f: F) -> Selfwhere
F: Future<Output = MSG> + 'static,
pub fn once<F>(f: F) -> Selfwhere
F: Future<Output = MSG> + 'static,
Creates a Cmd which expects to be polled only once
Sourcepub fn recurring(
rx: UnboundedReceiver<MSG>,
event_closure: Closure<dyn FnMut(Event)>,
) -> Self
pub fn recurring( rx: UnboundedReceiver<MSG>, event_closure: Closure<dyn FnMut(Event)>, ) -> Self
Creates a Cmd which will be polled multiple times
Sourcepub fn map_msg<F, MSG2>(self, f: F) -> Cmd<MSG2>
pub fn map_msg<F, MSG2>(self, f: F) -> Cmd<MSG2>
map the msg of this Cmd such that Cmd
Sourcepub fn batch(tasks: impl IntoIterator<Item = Self>) -> Self
pub fn batch(tasks: impl IntoIterator<Item = Self>) -> Self
batch together multiple Cmd into one task
Trait Implementations§
Source§impl<APP> From<Cmd<<APP as Application>::MSG>> for Dispatch<APP>where
APP: Application,
impl<APP> From<Cmd<<APP as Application>::MSG>> for Dispatch<APP>where
APP: Application,
Auto Trait Implementations§
impl<MSG> Freeze for Cmd<MSG>
impl<MSG> !RefUnwindSafe for Cmd<MSG>
impl<MSG> !Send for Cmd<MSG>
impl<MSG> !Sync for Cmd<MSG>
impl<MSG> Unpin for Cmd<MSG>
impl<MSG> !UnwindSafe for Cmd<MSG>
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