pub struct TokioRT {}Trait Implementations§
Source§impl AsyncIO for TokioRT
impl AsyncIO for TokioRT
Source§type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = TokioFD<T>
type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = TokioFD<T>
The type used to represent async file descriptors. Read more
Source§async fn connect_tcp(addr: &SocketAddr) -> Result<Self::AsyncFd<TcpStream>>
async fn connect_tcp(addr: &SocketAddr) -> Result<Self::AsyncFd<TcpStream>>
Connect to a TCP address asynchronously. Read more
Source§async fn connect_unix(addr: &Path) -> Result<Self::AsyncFd<UnixStream>>
async fn connect_unix(addr: &Path) -> Result<Self::AsyncFd<UnixStream>>
Connect to a Unix socket address asynchronously. Read more
Source§impl AsyncRuntime for TokioRT
impl AsyncRuntime for TokioRT
Source§fn current() -> Self::Exec
fn current() -> Self::Exec
Initiate executor using current thread.
§Safety
You should run AsyncExec::block_on() with this executor.
If spawn without a block_on() running, it’s possible
the runtime just init future without scheduling.
Source§fn one() -> Self::Exec
fn one() -> Self::Exec
Initiate executor with one background thread.
§NOTE
AsyncExec::block_on() is optional, you can directly call AsyncExec::spawn with it.
Source§fn multi(num: usize) -> Self::Exec
fn multi(num: usize) -> Self::Exec
Initiate executor with multiple background threads.
§NOTE
When num == 0, start threads that match cpu number.
AsyncExec::block_on() is optional, you can directly call AsyncExec::spawn with it.
Source§fn spawn<F, R>(f: F) -> TokioJoinHandle<R> ⓘ
fn spawn<F, R>(f: F) -> TokioJoinHandle<R> ⓘ
Spawn a task in the background, returning a handle to await its result
Source§fn spawn_detach<F, R>(f: F)
fn spawn_detach<F, R>(f: F)
Spawn a task and detach it (no handle returned)
type Exec = TokioExec
Source§fn spawn_blocking<F, R>(f: F) -> TokioThreadHandle<R> ⓘ
fn spawn_blocking<F, R>(f: F) -> TokioThreadHandle<R> ⓘ
Run blocking code with the thread context in blocking thread pool,
and return an async join handle Read more
Auto Trait Implementations§
impl Freeze for TokioRT
impl RefUnwindSafe for TokioRT
impl Send for TokioRT
impl Sync for TokioRT
impl Unpin for TokioRT
impl UnsafeUnpin for TokioRT
impl UnwindSafe for TokioRT
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