pub struct SmolRT(/* private fields */);Expand description
The SmolRT implements AsyncRuntime trait
Implementations§
Trait Implementations§
Source§impl AsyncExec for SmolRT
impl AsyncExec for SmolRT
Source§fn spawn<F, R>(&self, f: F) -> Self::AsyncHandle<R>
fn spawn<F, R>(&self, f: F) -> Self::AsyncHandle<R>
Spawn a task in the background
Source§fn spawn_detach<F, R>(&self, f: F)
fn spawn_detach<F, R>(&self, f: F)
Depends on how you initialize SmolRT, spawn with executor or globally
Source§fn block_on<F, R>(&self, f: F) -> R
fn block_on<F, R>(&self, f: F) -> R
Run a future to completion on the runtime
NOTE: when initialized with an executor, will block current thread until the future returns
type AsyncHandle<R: Send> = SmolJoinHandle<R>
type ThreadHandle<R: Send> = BlockingJoinHandle<R>
Source§fn spawn_blocking<F, R>(f: F) -> Self::ThreadHandle<R>
fn spawn_blocking<F, R>(f: F) -> Self::ThreadHandle<R>
Run blocking code in a background thread pool, and return an async join handle Read more
Source§impl AsyncIO for SmolRT
impl AsyncIO for SmolRT
Source§type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = SmolFD<T>
type AsyncFd<T: AsRawFd + AsFd + Send + Sync + 'static> = SmolFD<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 AsyncTime for SmolRT
impl AsyncTime for SmolRT
impl AsyncRuntime for SmolRT
Auto Trait Implementations§
impl Freeze for SmolRT
impl RefUnwindSafe for SmolRT
impl Send for SmolRT
impl Sync for SmolRT
impl Unpin for SmolRT
impl UnwindSafe for SmolRT
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