Tokio

Struct Tokio 

Source
pub struct Tokio { /* private fields */ }
Expand description

Dummy object implementing async common interfaces on top of tokio

Implementations§

Source§

impl Tokio

Source

pub fn with_handle(self, handle: Handle) -> Self

Bind to the tokio Runtime associated to this handle by default.

Source

pub fn with_runtime(self, runtime: TokioRT) -> Self

Bind to the tokio Runtime associated to this handle by default.

Source

pub fn current() -> Self

Bind to the current tokio Runtime by default.

Trait Implementations§

Source§

impl Clone for Tokio

Source§

fn clone(&self) -> Tokio

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tokio

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Tokio

Source§

fn default() -> Tokio

Returns the “default value” for a type. Read more
Source§

impl Executor for Tokio

Source§

type Task<T: Send + 'static> = TTask<T>

The type representing the tasks the are returned when spawning a Future on the executor
Source§

fn block_on<T, F: Future<Output = T>>(&self, f: F) -> T

Block on a future until completion
Source§

fn spawn<T: Send + 'static, F: Future<Output = T> + Send + 'static>( &self, f: F, ) -> Task<Self::Task<T>>

Spawn a future and return a handle to track its completion.
Source§

fn spawn_blocking<T: Send + 'static, F: FnOnce() -> T + Send + 'static>( &self, f: F, ) -> Task<Self::Task<T>>

Convert a blocking task into a future, spawning it on a decicated thread pool
Source§

impl Reactor for Tokio

Source§

type TcpStream = Compat<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>

Register a synchronous handle, returning an asynchronous one
Source§

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

Stream that yields at every given interval
Source§

fn tcp_connect_addr( &self, addr: SocketAddr, ) -> impl Future<Output = Result<Self::TcpStream>> + Send + 'static

Create a TcpStream by connecting to a remote host
Source§

fn tcp_connect<A: AsyncToSocketAddrs + Send>( &self, addrs: A, ) -> impl Future<Output = Result<Self::TcpStream>> + Send
where Self: Sync + Sized,

Create a TcpStream by connecting to a remote host
Source§

impl RuntimeKit for Tokio

Auto Trait Implementations§

§

impl Freeze for Tokio

§

impl RefUnwindSafe for Tokio

§

impl Send for Tokio

§

impl Sync for Tokio

§

impl Unpin for Tokio

§

impl UnwindSafe for Tokio

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,