pub struct Runtime<RK: RuntimeKit> { /* private fields */ }
Expand description
A full-featured Runtime implementation
Implementations§
Source§impl<RK: RuntimeKit> Runtime<RK>
impl<RK: RuntimeKit> Runtime<RK>
Sourcepub fn to_socket_addrs<A: ToSocketAddrs + Send + 'static>(
&self,
addrs: A,
) -> SocketAddrsResolver<'_, RK, A>
pub fn to_socket_addrs<A: ToSocketAddrs + Send + 'static>( &self, addrs: A, ) -> SocketAddrsResolver<'_, RK, A>
Asynchronously resolve the given domain name
Source§impl Runtime<RuntimeParts<AsyncGlobalExecutor, AsyncIO>>
impl Runtime<RuntimeParts<AsyncGlobalExecutor, AsyncIO>>
Sourcepub fn async_global_executor() -> Self
pub fn async_global_executor() -> Self
Create a new SmolRuntime
Source§impl Runtime<Tokio>
impl Runtime<Tokio>
Sourcepub fn tokio_current() -> Self
pub fn tokio_current() -> Self
Create a new TokioRuntime and bind it to the current tokio runtime by default.
Sourcepub fn tokio_with_handle(handle: Handle) -> Self
pub fn tokio_with_handle(handle: Handle) -> Self
Create a new TokioRuntime and bind it to the tokio runtime associated to this handle by default.
Sourcepub fn tokio_with_runtime(runtime: TokioRT) -> Self
pub fn tokio_with_runtime(runtime: TokioRT) -> Self
Create a new TokioRuntime and bind it to this tokio runtime.
Trait Implementations§
Source§impl<RK: RuntimeKit> Executor for Runtime<RK>
impl<RK: RuntimeKit> Executor for Runtime<RK>
Source§type Task<T: Send + 'static> = <RK as Executor>::Task<T>
type Task<T: Send + 'static> = <RK as Executor>::Task<T>
The type representing the tasks the are returned when spawning a Future on the executor
Source§impl<RK: RuntimeKit> From<RK> for Runtime<RK>
impl<RK: RuntimeKit> From<RK> for Runtime<RK>
Source§impl<RK: RuntimeKit> Reactor for Runtime<RK>
impl<RK: RuntimeKit> Reactor for Runtime<RK>
Source§type TcpStream = <RK as Reactor>::TcpStream
type TcpStream = <RK as Reactor>::TcpStream
The type representing a TCP stream (after tcp_connect) for this reactor
Source§fn register<H: Read + Write + AsSysFd + Send + 'static>(
&self,
socket: H,
) -> Result<impl AsyncRead + AsyncWrite + Send + Unpin + 'static>
fn register<H: Read + Write + AsSysFd + Send + 'static>( &self, socket: H, ) -> Result<impl AsyncRead + AsyncWrite + Send + Unpin + 'static>
Register a synchronous handle, returning an asynchronous one
Source§fn sleep(&self, dur: Duration) -> impl Future<Output = ()> + Send + 'static
fn sleep(&self, dur: Duration) -> impl Future<Output = ()> + Send + 'static
Sleep for the given duration
Source§fn interval(
&self,
dur: Duration,
) -> impl Stream<Item = Instant> + Send + 'static
fn interval( &self, dur: Duration, ) -> impl Stream<Item = Instant> + Send + 'static
Stream that yields at every given interval
Source§fn tcp_connect_addr(
&self,
addr: SocketAddr,
) -> impl Future<Output = Result<Self::TcpStream>> + Send + 'static
fn tcp_connect_addr( &self, addr: SocketAddr, ) -> impl Future<Output = Result<Self::TcpStream>> + Send + 'static
Create a TcpStream by connecting to a remote host
Auto Trait Implementations§
impl<RK> Freeze for Runtime<RK>where
RK: Freeze,
impl<RK> RefUnwindSafe for Runtime<RK>where
RK: RefUnwindSafe,
impl<RK> Send for Runtime<RK>where
RK: Send,
impl<RK> Sync for Runtime<RK>where
RK: Sync,
impl<RK> Unpin for Runtime<RK>where
RK: Unpin,
impl<RK> UnwindSafe for Runtime<RK>where
RK: UnwindSafe,
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