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
Source§fn run<F, T>(future: F) -> T
fn run<F, T>(future: F) -> T
Convenience method: create a runtime and run the future to completion. Read more
Source§fn spawn_blocking<F, T>(f: F) -> impl Future<Output = Result<T, Error>> + Send
fn spawn_blocking<F, T>(f: F) -> impl Future<Output = Result<T, Error>> + Send
Run a blocking function on a separate thread. Read more
Source§fn mpsc_recv_deadline<T>(
receiver: &mut <Self::Mpsc as Mpsc>::Receiver<T>,
deadline: Self::Instant,
) -> impl Future<Output = Result<T, TryRecvError>> + OptionalSendwhere
T: OptionalSend,
fn mpsc_recv_deadline<T>(
receiver: &mut <Self::Mpsc as Mpsc>::Receiver<T>,
deadline: Self::Instant,
) -> impl Future<Output = Result<T, TryRecvError>> + OptionalSendwhere
T: OptionalSend,
Try to poll a value from the channel within the given deadline. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CompioRuntime
impl !Send for CompioRuntime
impl !Sync for CompioRuntime
impl !UnwindSafe for CompioRuntime
impl Freeze for CompioRuntime
impl Unpin for CompioRuntime
impl UnsafeUnpin 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