pub struct SmolRT {}Trait Implementations§
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 AsyncRuntime for SmolRT
impl AsyncRuntime for SmolRT
Source§fn current() -> SmolExec
fn current() -> SmolExec
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() -> SmolExec
fn one() -> SmolExec
Initiate executor with one background thread.
§NOTE
AsyncExec::block_on() is optional, you can directly call AsyncExec::spawn with it.
Source§fn multi(size: usize) -> SmolExec
fn multi(size: usize) -> SmolExec
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) -> SmolJoinHandle<R> ⓘ
fn spawn<F, R>(f: F) -> SmolJoinHandle<R> ⓘ
Spawn a task in the background
Source§fn spawn_detach<F, R>(f: F)
fn spawn_detach<F, R>(f: F)
Depends on how you initialize SmolRT, spawn with executor or globally
type Exec = SmolExec
Source§fn spawn_blocking<F, R>(f: F) -> BlockingJoinHandle<R> ⓘ
fn spawn_blocking<F, R>(f: F) -> BlockingJoinHandle<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 SmolRT
impl RefUnwindSafe for SmolRT
impl Send for SmolRT
impl Sync for SmolRT
impl Unpin for SmolRT
impl UnsafeUnpin 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