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§
Source§impl<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§
Source§impl<T> Clone for ReadHandleFactory<T>
impl<T> Clone for ReadHandleFactory<T>
Auto Trait Implementations§
impl<T> Freeze for ReadHandleFactory<T>
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§
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