pub struct NativeArchive<P: CopperListTuple> { /* private fields */ }Expand description
One application-typed archive per (session id, sender id). Pass all ordered
router events for that sender to accept. The expected schema comes from
P’s generated output specs, independently of the remote manifest.
CaptureArchive applies the generated selective codec for a live twin.
A write failure poisons the writer: do not retry a partially committed event.
Implementations§
Source§impl<P: CopperListTuple> NativeArchive<P>
impl<P: CopperListTuple> NativeArchive<P>
Sourcepub fn new(
path: &Path,
received: &ReceivedManifest,
slab_bytes: usize,
section_bytes: usize,
) -> Result<Self>
pub fn new( path: &Path, received: &ReceivedManifest, slab_bytes: usize, section_bytes: usize, ) -> Result<Self>
Creates native message, task state, continuity and structured log sections. The section size must fit the largest accepted canonical entry.
Sourcepub fn accept(
&mut self,
event: &SessionEventRef<'_>,
) -> Result<Option<CopperList<P>>>
pub fn accept( &mut self, event: &SessionEventRef<'_>, ) -> Result<Option<CopperList<P>>>
Validates a typed CopperList once, appends its original canonical bytes, and returns the typed value for an in-process consumer. Keyframes are archived only after the router has verified their recovery point references.
Sourcepub fn take_structured_log(&mut self) -> Option<CuLogEntry>
pub fn take_structured_log(&mut self) -> Option<CuLogEntry>
Move the structured entry decoded during the most recent successful accept. Call before accepting another event; publication can reuse this owned value.
Auto Trait Implementations§
impl<P> !RefUnwindSafe for NativeArchive<P>
impl<P> !UnwindSafe for NativeArchive<P>
impl<P> Freeze for NativeArchive<P>
impl<P> Send for NativeArchive<P>
impl<P> Sync for NativeArchive<P>
impl<P> Unpin for NativeArchive<P>
impl<P> UnsafeUnpin for NativeArchive<P>where
PhantomData<P>: UnsafeUnpin,
fn(&[u8]) -> Result<(CapturedList<P>, &[u8]), Error>: UnsafeUnpin,
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
impl<T> GetTypeRegistration for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more