pub struct RuntimelessRuntime(/* private fields */);Expand description
a runtime that isn’t a runtime
Implementations§
Source§impl RuntimelessRuntime
impl RuntimelessRuntime
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 RuntimelessRuntime
impl Clone for RuntimelessRuntime
Source§fn clone(&self) -> RuntimelessRuntime
fn clone(&self) -> RuntimelessRuntime
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 RuntimelessRuntime
impl Debug for RuntimelessRuntime
Source§impl Default for RuntimelessRuntime
impl Default for RuntimelessRuntime
Source§fn default() -> RuntimelessRuntime
fn default() -> RuntimelessRuntime
Returns the “default value” for a type. Read more
Source§impl From<RuntimelessRuntime> for Runtime
impl From<RuntimelessRuntime> for Runtime
Source§fn from(value: RuntimelessRuntime) -> Self
fn from(value: RuntimelessRuntime) -> Self
Converts to this type from the input type.
Source§impl RuntimeTrait for RuntimelessRuntime
impl RuntimeTrait for RuntimelessRuntime
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 timeout<'runtime, 'fut, Fut>(
&'runtime self,
duration: Duration,
fut: Fut,
) -> impl Future<Output = Option<<Fut as Future>::Output>> + Send + 'fut
fn timeout<'runtime, 'fut, Fut>( &'runtime self, duration: Duration, fut: Fut, ) -> impl Future<Output = Option<<Fut as Future>::Output>> + Send + 'fut
Race a future against the provided duration, returning None in case of timeout.
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 RuntimelessRuntime
Auto Trait Implementations§
impl Freeze for RuntimelessRuntime
impl RefUnwindSafe for RuntimelessRuntime
impl Send for RuntimelessRuntime
impl Sync for RuntimelessRuntime
impl Unpin for RuntimelessRuntime
impl UnsafeUnpin for RuntimelessRuntime
impl UnwindSafe for RuntimelessRuntime
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