pub struct SwmrReaderFactory<T: 'static, const RP: bool = false> { /* private fields */ }Expand description
A handle for creating LocalReaders that can be shared across threads.
Unlike LocalReader, which is !Sync and bound to a single thread,
SwmrReaderFactory is Sync and Clone. It holds a reference to the shared state
but does not register a reader slot until local_reader() is called.
可以跨线程共享的用于创建 LocalReader 的句柄。
与 !Sync 且绑定到单个线程的 LocalReader 不同,
SwmrReaderFactory 是 Sync 和 Clone 的。它持有对共享状态的引用,
但直到调用 local_reader() 时才注册读者槽。
Implementations§
Source§impl<T: 'static, const RP: bool> SwmrReaderFactory<T, RP>
impl<T: 'static, const RP: bool> SwmrReaderFactory<T, RP>
Sourcepub fn local_reader(&self) -> LocalReader<T, RP>
pub fn local_reader(&self) -> LocalReader<T, RP>
Create a new LocalReader for the current thread.
为当前线程创建一个新的 LocalReader。
Trait Implementations§
Source§impl<T: 'static, const RP: bool> Clone for SwmrReaderFactory<T, RP>
impl<T: 'static, const RP: bool> Clone for SwmrReaderFactory<T, RP>
Auto Trait Implementations§
impl<T, const RP: bool> Freeze for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> RefUnwindSafe for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> Send for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> Sync for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> Unpin for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> UnsafeUnpin for SwmrReaderFactory<T, RP>
impl<T, const RP: bool> UnwindSafe for SwmrReaderFactory<T, RP>
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