pub struct CompioRuntime { /* private fields */ }Expand description
Compio async runtime.
Trait Implementations§
Source§impl AsyncRuntime for CompioRuntime
impl AsyncRuntime for CompioRuntime
Source§type JoinError = CompioJoinError
type JoinError = CompioJoinError
The error type of
Self::JoinHandle.Source§type JoinHandle<T: OptionalSend + 'static> = CompioJoinHandle<T>
type JoinHandle<T: OptionalSend + 'static> = CompioJoinHandle<T>
The return type of
Self::spawn.Source§type Sleep = Pin<Box<dyn Future<Output = ()>>>
type Sleep = Pin<Box<dyn Future<Output = ()>>>
The type that enables the user to sleep in an asynchronous runtime.
Source§type TimeoutError = Elapsed
type TimeoutError = Elapsed
The timeout error type.
Source§type Timeout<R, T: Future<Output = R> + OptionalSend> = CompioTimeout<T>
type Timeout<R, T: Future<Output = R> + OptionalSend> = CompioTimeout<T>
The timeout type used by
Self::timeout and Self::timeout_at that enables the user
to await the outcome of a Future.Source§type ThreadLocalRng = ThreadRng
type ThreadLocalRng = ThreadRng
Type of thread-local random number generator.
Source§type Mutex<T: OptionalSend + 'static> = FlumeMutex<T>
type Mutex<T: OptionalSend + 'static> = FlumeMutex<T>
The async mutex implementation.
Source§fn spawn<T>(fut: T) -> Self::JoinHandle<T::Output>
fn spawn<T>(fut: T) -> Self::JoinHandle<T::Output>
Spawn a new task.
Source§fn sleep_until(deadline: Self::Instant) -> Self::Sleep
fn sleep_until(deadline: Self::Instant) -> Self::Sleep
Wait until
deadline is reached.Source§fn timeout<R, F: Future<Output = R> + OptionalSend>(
duration: Duration,
future: F,
) -> Self::Timeout<R, F>
fn timeout<R, F: Future<Output = R> + OptionalSend>( duration: Duration, future: F, ) -> Self::Timeout<R, F>
Require a
Future to complete before the specified duration has elapsed.Source§fn timeout_at<R, F: Future<Output = R> + OptionalSend>(
deadline: Self::Instant,
future: F,
) -> Self::Timeout<R, F>
fn timeout_at<R, F: Future<Output = R> + OptionalSend>( deadline: Self::Instant, future: F, ) -> Self::Timeout<R, F>
Require a
Future to complete before the specified instant in time.Source§fn thread_rng() -> Self::ThreadLocalRng
fn thread_rng() -> Self::ThreadLocalRng
Get the random number generator to use for generating random numbers. Read more
Source§fn block_on<F, T>(&mut self, future: F) -> Twhere
F: Future<Output = T>,
T: OptionalSend,
fn block_on<F, T>(&mut self, future: F) -> Twhere
F: Future<Output = T>,
T: OptionalSend,
Run a future to completion on this runtime. Read more
Auto Trait Implementations§
impl !Freeze for CompioRuntime
impl !RefUnwindSafe for CompioRuntime
impl !Send for CompioRuntime
impl !Sync for CompioRuntime
impl Unpin for CompioRuntime
impl UnsafeUnpin for CompioRuntime
impl !UnwindSafe for CompioRuntime
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more