Struct left_right::ReadHandleFactory
source · [−]pub struct ReadHandleFactory<T> { /* private fields */ }
Expand description
A type that is both Sync
and Send
and lets you produce new ReadHandle
instances.
This serves as a handy way to distribute read handles across many threads without requiring
additional external locking to synchronize access to the non-Sync
ReadHandle
type. Note
that this internally takes a lock whenever you call ReadHandleFactory::handle
, so
you should not expect producing new handles rapidly to scale well.
Implementations
sourceimpl<T> ReadHandleFactory<T>
impl<T> ReadHandleFactory<T>
sourcepub fn handle(&self) -> ReadHandle<T>
pub fn handle(&self) -> ReadHandle<T>
Produce a new ReadHandle
to the same left-right data structure as this factory was
originally produced from.
Trait Implementations
sourceimpl<T> Clone for ReadHandleFactory<T>
impl<T> Clone for ReadHandleFactory<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ReadHandleFactory<T>
impl<T> Send for ReadHandleFactory<T>
impl<T> Sync for ReadHandleFactory<T>
impl<T> Unpin for ReadHandleFactory<T>
impl<T> UnwindSafe for ReadHandleFactory<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more