pub struct SharedHandleTable<T: Copy + 'static> { /* private fields */ }Implementations§
pub fn create( path: impl AsRef<Path>, capacity: usize, ) -> Result<Self, HandleTableError>
pub fn open( path: impl AsRef<Path>, expected_capacity: usize, ) -> Result<Self, HandleTableError>
pub fn capacity(&self) -> usize
pub fn header(&self) -> &HandleHeader
Sourcepub fn insert(&self, value: T) -> Result<Handle, HandleTableError>
pub fn insert(&self, value: T) -> Result<Handle, HandleTableError>
Insert value, returning a Handle. Errors with Full when
the slot table is exhausted.
Sourcepub fn get(&self, h: Handle) -> Option<T>
pub fn get(&self, h: Handle) -> Option<T>
Look up by handle. Returns None when the handle is stale
(generation mismatch) or the slot is currently vacant.
Sourcepub fn remove(&self, h: Handle) -> Option<T>
pub fn remove(&self, h: Handle) -> Option<T>
Remove the value at handle. Returns the value if live,
None if stale or already removed.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn flush_async(&self) -> Result<(), HandleTableError>
pub fn flush_async(&self) -> Result<(), HandleTableError>
Non-blocking flush: schedules a writeback via the OS. Note: Windows is only partially async (sync to page cache, not to disk).
pub fn flush(&self) -> Result<(), HandleTableError>
Trait Implementations§
fn header(&self) -> &HandshakeHeader
fn ring(&self) -> &ObservationRing
fn make_policy(&self) -> Box<dyn Policy>
Source§fn apply_migration(&self, new_tag: u32)
fn apply_migration(&self, new_tag: u32)
Called by the sidecar when the policy returns a new strategy
tag. Default implementation: just set the tag on the header.
Primitives that need heavier migration (data-layout swap)
override this to perform the swap before (or after) updating
the tag.
Auto Trait Implementations§
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