pub struct Pool { /* private fields */ }Expand description
A pool of samples in shared memory, made by a writer for the samples it loans (zero-copy): fixed-size slots that the writer fills and the readers of this host map and read in place. A slot is reused once no one holds a reference to it: the writer, while the sample is in its history, and each reader, while it has the sample.
Each slot has a generation, changed each time the writer takes it, so that a reference to an older sample of the slot is not taken for the new one.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn create(dir: &Path, slots: u32, slot_size: usize) -> Result<Arc<Pool>>
pub fn create(dir: &Path, slots: u32, slot_size: usize) -> Result<Arc<Pool>>
Makes a pool of slots slots for payloads of up to slot_size
octets (rounded up, see Self::slot_size) in dir.
Sourcepub fn open(dir: &Path, id: u64) -> Result<Arc<Pool>>
pub fn open(dir: &Path, id: u64) -> Result<Arc<Pool>>
Maps the pool id of dir, made by a writer of this host.
Trait Implementations§
impl Send for Pool
impl Sync for Pool
Auto Trait Implementations§
impl Forget for Pool
impl Freeze for Pool
impl Move for Pool
impl RefUnwindSafe for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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