Struct iced_futures::Runtime
source · pub struct Runtime<Executor, Sender, Message> { /* private fields */ }
Expand description
A batteries-included runtime of commands and subscriptions.
If you have an Executor
, a Runtime
can be leveraged to run any
Command
or Subscription
and get notified of the results!
Implementations§
source§impl<Executor, Sender, Message> Runtime<Executor, Sender, Message>
impl<Executor, Sender, Message> Runtime<Executor, Sender, Message>
sourcepub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
pub fn enter<R>(&self, f: impl FnOnce() -> R) -> R
Runs the given closure inside the Executor
of the Runtime
.
See Executor::enter
to learn more.
sourcepub fn track(
&mut self,
recipes: impl IntoIterator<Item = Box<dyn Recipe<Output = Message>>>
)
pub fn track( &mut self, recipes: impl IntoIterator<Item = Box<dyn Recipe<Output = Message>>> )
Tracks a Subscription
in the Runtime
.
It will spawn new streams or close old ones as necessary! See
Tracker::update
to learn more about this!
Trait Implementations§
Auto Trait Implementations§
impl<Executor, Sender, Message> !RefUnwindSafe for Runtime<Executor, Sender, Message>
impl<Executor, Sender, Message> Send for Runtime<Executor, Sender, Message>
impl<Executor, Sender, Message> Sync for Runtime<Executor, Sender, Message>
impl<Executor, Sender, Message> Unpin for Runtime<Executor, Sender, Message>
impl<Executor, Sender, Message> !UnwindSafe for Runtime<Executor, Sender, Message>
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