pub struct SmolRuntime(/* private fields */);Expand description
Runtime for Smol
Implementations§
Source§impl SmolRuntime
impl SmolRuntime
Sourcepub fn spawn<Fut>(
&self,
fut: Fut,
) -> DroppableFuture<impl Future<Output = Option<Fut::Output>> + Send + 'static + use<Fut>>
pub fn spawn<Fut>( &self, fut: Fut, ) -> DroppableFuture<impl Future<Output = Option<Fut::Output>> + Send + 'static + use<Fut>>
Spawn a future on the runtime, returning a future that has detach-on-drop semantics
Spawned tasks conform to the following behavior:
-
detach on drop: If the returned
DroppableFutureis dropped immediately, the task will continue to execute until completion. -
unwinding: If the spawned future panics, this must not propagate to the join handle. Instead, the awaiting the join handle returns None in case of panic.
Sourcepub fn interval(
&self,
period: Duration,
) -> impl Stream<Item = ()> + Send + 'static + use<>
pub fn interval( &self, period: Duration, ) -> impl Stream<Item = ()> + Send + 'static + use<>
Returns a Stream that yields a () on the provided period
Trait Implementations§
Source§impl Clone for SmolRuntime
impl Clone for SmolRuntime
Source§fn clone(&self) -> SmolRuntime
fn clone(&self) -> SmolRuntime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SmolRuntime
impl Debug for SmolRuntime
Source§impl Default for SmolRuntime
impl Default for SmolRuntime
Source§fn default() -> SmolRuntime
fn default() -> SmolRuntime
Returns the “default value” for a type. Read more
Source§impl From<SmolRuntime> for Runtime
impl From<SmolRuntime> for Runtime
Source§fn from(value: SmolRuntime) -> Self
fn from(value: SmolRuntime) -> Self
Converts to this type from the input type.
Source§impl RuntimeTrait for SmolRuntime
impl RuntimeTrait for SmolRuntime
Source§fn spawn<Fut>(
&self,
fut: Fut,
) -> DroppableFuture<impl Future<Output = Option<Fut::Output>> + Send + 'static>
fn spawn<Fut>( &self, fut: Fut, ) -> DroppableFuture<impl Future<Output = Option<Fut::Output>> + Send + 'static>
Spawn a future on the runtime, returning a future that has detach-on-drop semantics Read more
Source§fn interval(&self, period: Duration) -> impl Stream<Item = ()> + Send + 'static
fn interval(&self, period: Duration) -> impl Stream<Item = ()> + Send + 'static
Returns a
Stream that yields a () on the provided periodSource§fn block_on<Fut: Future>(&self, fut: Fut) -> Fut::Output
fn block_on<Fut: Future>(&self, fut: Fut) -> Fut::Output
Runtime implementation hook for blocking on a top level future.
Source§fn hook_signals(
&self,
signals: impl IntoIterator<Item = i32>,
) -> impl Stream<Item = i32> + Send + 'static
fn hook_signals( &self, signals: impl IntoIterator<Item = i32>, ) -> impl Stream<Item = i32> + Send + 'static
trap and return a
Stream of signals that match the provided signalsimpl Copy for SmolRuntime
Auto Trait Implementations§
impl Freeze for SmolRuntime
impl RefUnwindSafe for SmolRuntime
impl Send for SmolRuntime
impl Sync for SmolRuntime
impl Unpin for SmolRuntime
impl UnsafeUnpin for SmolRuntime
impl UnwindSafe for SmolRuntime
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