Skip to main content

NativeArchive

Struct NativeArchive 

Source
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>

Source

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.

Source

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.

Source

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.

Source

pub fn finish(self) -> Result<()>

Records the receiver’s final known boundary and closes native sections. The router must first be finalized through any caller-known sender tail.

Auto Trait Implementations§

§

impl<P> !RefUnwindSafe for NativeArchive<P>

§

impl<P> !UnwindSafe for NativeArchive<P>

§

impl<P> Freeze for NativeArchive<P>
where PhantomData<P>: Freeze, fn(&[u8]) -> Result<(CapturedList<P>, &[u8]), Error>: Freeze,

§

impl<P> Send for NativeArchive<P>
where PhantomData<P>: Send, fn(&[u8]) -> Result<(CapturedList<P>, &[u8]), Error>: Send,

§

impl<P> Sync for NativeArchive<P>
where PhantomData<P>: Sync, fn(&[u8]) -> Result<(CapturedList<P>, &[u8]), Error>: Sync,

§

impl<P> Unpin for NativeArchive<P>
where PhantomData<P>: Unpin, fn(&[u8]) -> Result<(CapturedList<P>, &[u8]), Error>: Unpin,

§

impl<P> UnsafeUnpin for NativeArchive<P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<A> Is for A
where A: Any,

§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. Read more
§

impl<T> PayloadDefaultHandlePolicyApply for T
where T: ?Sized,

§

fn apply_handle_content_policy(&self, _mode: HandleContent)

§

impl<T> PayloadDefaultLoggingPolicy for T
where T: ?Sized,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.