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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend 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