Trait tor_rtcompat::Runtime [−][src]
pub trait Runtime: Sync + Send + Spawn + SpawnBlocking + Clone + SleepProvider + TcpProvider + TlsProvider + 'static { }Expand description
A runtime that we can use to run Tor as a client.
This trait comprises several other traits that we require all of our runtimes to provide:
- [
futures::task::Spawn] to launch new background tasks. SleepProviderto pause a task for a given amount of time.TcpProviderto launch and accept TCP connections.TlsProviderto launch TLS connections.SpawnBlockingto block on a future and run it to completion (This may become optional in the future, if/when we add WASM support).
We require that every Runtime has an efficient Clone implementation
that gives a new opaque reference to the same underlying runtime.
Additionally, every Runtime is Send and Sync, though these
requirements may be somewhat relaxed in the future.