Struct tor_rtcompat::tokio::TokioRustlsRuntime
source · pub struct TokioRustlsRuntime { /* private fields */ }
native-tls
or rustls
) and crate feature tokio
and crate feature rustls
only.Expand description
A Runtime
built around a Handle to a tokio runtime, and rustls
.
Implementations§
source§impl TokioRustlsRuntime
impl TokioRustlsRuntime
sourcepub fn create() -> IoResult<Self>
pub fn create() -> IoResult<Self>
Create a new TokioRustlsRuntime
.
The return value will own the underlying Tokio runtime object, which will be dropped when the last copy of this handle is freed.
If you want to use a currently running runtime instead, call
TokioRustlsRuntime::current()
.
sourcepub fn current() -> IoResult<Self>
pub fn current() -> IoResult<Self>
Return a TokioRustlsRuntime
wrapping the currently running
Tokio runtime.
§Usage note
We should never call this from inside other Arti crates, or from library
crates that want to support multiple runtimes! This function is for
Arti users who want to wrap some existing Tokio runtime as a
Runtime
. It is not for library crates that want to work with
multiple runtimes.
Once you have a runtime returned by this function, you should just
create more handles to it via Clone
.
Trait Implementations§
source§impl BlockOn for TokioRustlsRuntime
impl BlockOn for TokioRustlsRuntime
source§impl Clone for TokioRustlsRuntime
impl Clone for TokioRustlsRuntime
source§fn clone(&self) -> TokioRustlsRuntime
fn clone(&self) -> TokioRustlsRuntime
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CoarseTimeProvider for TokioRustlsRuntime
impl CoarseTimeProvider for TokioRustlsRuntime
source§fn now_coarse(&self) -> CoarseInstant
fn now_coarse(&self) -> CoarseInstant
CoarseTimeProvider
’s view of the current instant. Read moresource§impl Debug for TokioRustlsRuntime
impl Debug for TokioRustlsRuntime
source§impl From<Handle> for TokioRustlsRuntime
impl From<Handle> for TokioRustlsRuntime
source§impl SleepProvider for TokioRustlsRuntime
impl SleepProvider for TokioRustlsRuntime
§type SleepFuture = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as SleepProvider>::SleepFuture
type SleepFuture = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as SleepProvider>::SleepFuture
SleepProvider::sleep()
source§fn sleep(&self, duration: Duration) -> Self::SleepFuture
fn sleep(&self, duration: Duration) -> Self::SleepFuture
duration
has
elapsed.source§fn wallclock(&self) -> SystemTime
fn wallclock(&self) -> SystemTime
source§fn block_advance<T: Into<String>>(&self, _reason: T)
fn block_advance<T: Into<String>>(&self, _reason: T)
source§fn release_advance<T: Into<String>>(&self, _reason: T)
fn release_advance<T: Into<String>>(&self, _reason: T)
block_advance
no
longer exists, and it’s fine to move time forward if nothing else is blocking advances. Read moresource§fn allow_one_advance(&self, _dur: Duration)
fn allow_one_advance(&self, _dur: Duration)
block_advance
API has been used. Read moresource§impl Spawn for TokioRustlsRuntime
impl Spawn for TokioRustlsRuntime
source§impl TcpProvider for TokioRustlsRuntime
impl TcpProvider for TokioRustlsRuntime
§type TcpStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TcpProvider>::TcpStream
type TcpStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TcpProvider>::TcpStream
Self::connect()
.§type TcpListener = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TcpProvider>::TcpListener
type TcpListener = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TcpProvider>::TcpListener
Self::listen()
.source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = Result<Self::TcpStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = Result<Self::TcpStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = Result<Self::TcpListener>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn listen<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr
) -> Pin<Box<dyn Future<Output = Result<Self::TcpListener>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
source§impl<S> TlsProvider<S> for TokioRustlsRuntime
impl<S> TlsProvider<S> for TokioRustlsRuntime
§type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector
type Connector = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::Connector
§type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream
type TlsStream = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as TlsProvider<S>>::TlsStream
source§fn tls_connector(&self) -> Self::Connector
fn tls_connector(&self) -> Self::Connector
source§impl UdpProvider for TokioRustlsRuntime
impl UdpProvider for TokioRustlsRuntime
§type UdpSocket = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as UdpProvider>::UdpSocket
type UdpSocket = <CompoundRuntime<TokioRuntimeHandle, TokioRuntimeHandle, RealCoarseTimeProvider, TokioRuntimeHandle, RustlsProvider, TokioRuntimeHandle> as UdpProvider>::UdpSocket
Self::bind()
Auto Trait Implementations§
impl Freeze for TokioRustlsRuntime
impl !RefUnwindSafe for TokioRustlsRuntime
impl Send for TokioRustlsRuntime
impl Sync for TokioRustlsRuntime
impl Unpin for TokioRustlsRuntime
impl !UnwindSafe for TokioRustlsRuntime
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> SleepProviderExt for Twhere
T: SleepProvider,
impl<T> SleepProviderExt for Twhere
T: SleepProvider,
source§fn timeout<F: Future>(
&self,
duration: Duration,
future: F
) -> Timeout<F, Self::SleepFuture> ⓘ
fn timeout<F: Future>( &self, duration: Duration, future: F ) -> Timeout<F, Self::SleepFuture> ⓘ
source§fn sleep_until_wallclock(
&self,
when: SystemTime
) -> SleepUntilWallclock<'_, Self>
fn sleep_until_wallclock( &self, when: SystemTime ) -> SleepUntilWallclock<'_, Self>
when
or later, trying to
recover from clock jumps. Read more§impl<Sp> SpawnExt for Spwhere
Sp: Spawn + ?Sized,
impl<Sp> SpawnExt for Spwhere
Sp: Spawn + ?Sized,
§fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
alloc
only.()
to
completion. Read more