pub struct FlatReader<T: FlatStruct> { /* private fields */ }Expand description
Liest FlatStruct-Samples direkt aus SHM-Slots.
Implementations§
Source§impl<T: FlatStruct> FlatReader<T>
impl<T: FlatStruct> FlatReader<T>
Sourcepub fn new(alloc: Arc<InMemorySlotAllocator>, reader_index: u8) -> Self
pub fn new(alloc: Arc<InMemorySlotAllocator>, reader_index: u8) -> Self
Erzeugt einen Reader ueber einem Allocator.
Sourcepub fn read(&self) -> Result<Option<T>, SlotError>
pub fn read(&self) -> Result<Option<T>, SlotError>
Spec §9.1 read_flat. Liefert das neueste ungelesene Sample. Setzt automatisch das reader-Bit im reader_mask.
Spec §6.1 Type-Hash-Cross-Validation: vor dem Slot-Read wird
T::TYPE_HASH gegen den am SlotBackend hinterlegten Hash
geprueft. Bei Mismatch: keine Slots werden dereferenziert,
Err(SlotError::SampleTooLarge) mit Schema-Drift-Indikation.
§Errors
SampleTooLargebei TYPE_HASH-Mismatch (Spec §6.1).- Wire-/Layout-Fehler oder Slot-Lock-Poison wie sonst.
Auto Trait Implementations§
impl<T> !Freeze for FlatReader<T>
impl<T> RefUnwindSafe for FlatReader<T>
impl<T> Send for FlatReader<T>
impl<T> Sync for FlatReader<T>
impl<T> Unpin for FlatReader<T>
impl<T> UnsafeUnpin for FlatReader<T>
impl<T> UnwindSafe for FlatReader<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