Struct iroh_bytes::util::runtime::Handle
source · pub struct Handle { /* private fields */ }Expand description
A handle to the iroh runtime
Implementations§
source§impl Handle
impl Handle
sourcepub fn new(rt: Handle, tpc: LocalPoolHandle) -> Self
pub fn new(rt: Handle, tpc: LocalPoolHandle) -> Self
Create a new iroh runtime consisting of a tokio runtime and a thread per core runtime.
sourcepub fn from_current(size: usize) -> Result<Self, TryCurrentError>
pub fn from_current(size: usize) -> Result<Self, TryCurrentError>
Create a new iroh runtime using the current tokio runtime as the main runtime, and the given number of thread per core executors.
sourcepub fn local_pool(&self) -> &LocalPoolHandle
pub fn local_pool(&self) -> &LocalPoolHandle
Get a handle to the thread pool for single threaded executors
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
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