pub struct SharedHandler { /* private fields */ }Expand description
A lightweight reflection of the original handler that can be safely sent across threads.
Produced by MatrixHandler::share(). Holds raw pointers into the SHM
segment. The originating MatrixHandler must outlive all
SharedHandler instances derived from it.
SharedHandler exposes the same allocation, I/O, lifecycle, and escape
hatch API as MatrixHandler via the HandlerFunctions trait —
it does not own the mmap.
Trait Implementations§
Source§fn matrix(&self) -> &AtomicMatrix
fn matrix(&self) -> &AtomicMatrix
Returns a reference to the underlying
AtomicMatrix.Source§fn first_block_offset(&self) -> u32
fn first_block_offset(&self) -> u32
Returns the offset of the first data block in the segment.
Used by
internals iterators as the physical chain walk start point.Source§fn segment_size(&self) -> u32
fn segment_size(&self) -> u32
Returns the total segment size in bytes.
Source§fn allocate<T>(&self) -> Result<Block<T>, HandlerError>
fn allocate<T>(&self) -> Result<Block<T>, HandlerError>
Allocates a block sized to hold
T. Read moreSource§fn allocate_raw(&self, size: u32) -> Result<RelativePtr<u8>, HandlerError>
fn allocate_raw(&self, size: u32) -> Result<RelativePtr<u8>, HandlerError>
Allocates a raw byte block of the given size. Read more
Source§unsafe fn write<T>(&self, block: &mut Block<T>, value: T)
unsafe fn write<T>(&self, block: &mut Block<T>, value: T)
Writes a value of type
T into an allocated block. Read moreSource§unsafe fn read<'a, T>(&self, block: &Block<T>) -> &'a T
unsafe fn read<'a, T>(&self, block: &Block<T>) -> &'a T
Reads a shared reference to
T from an allocated block. Read moreSource§unsafe fn read_mut<'a, T>(&self, block: &Block<T>) -> &'a mut T
unsafe fn read_mut<'a, T>(&self, block: &Block<T>) -> &'a mut T
Reads a mutable reference to
T from an allocated block. Read moreSource§fn set_state<T>(&self, block: &Block<T>, state: u32) -> Result<(), HandlerError>
fn set_state<T>(&self, block: &Block<T>, state: u32) -> Result<(), HandlerError>
Sets a user-defined lifecycle state on a block. Read more
Source§fn get_state<T>(&self, block: &Block<T>, order: Ordering) -> u32
fn get_state<T>(&self, block: &Block<T>, order: Ordering) -> u32
Returns the current state of a block. Read more
Source§fn transition_state<T>(
&self,
block: &Block<T>,
expected: u32,
next: u32,
success_order: Ordering,
) -> Result<u32, HandlerError>
fn transition_state<T>( &self, block: &Block<T>, expected: u32, next: u32, success_order: Ordering, ) -> Result<u32, HandlerError>
Atomically transitions a block from one state to another. Read more
Source§fn raw_matrix(&self) -> &AtomicMatrix
fn raw_matrix(&self) -> &AtomicMatrix
Returns a raw reference to the underlying
AtomicMatrix. Read moreAuto 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