Skip to main content

PeatLiteDocumentFrame

Struct PeatLiteDocumentFrame 

Source
pub struct PeatLiteDocumentFrame {
    pub source_node_id: u32,
    pub seq_num: u32,
    pub flags: u8,
    pub collection: String,
    pub doc_id: String,
    pub timestamp_ms: i64,
    pub body: Vec<u8>,
}
Expand description

Owned snapshot of a decoded peat-lite Document frame, surfaced via DataReceivedResult::peat_lite_document when the receive dispatch successfully decodes a MessageType::Document envelope.

Mirrors the DecodedTranslatorFrame design pattern: defined unconditionally so the UniFFI binding shape stays stable across feature combos. Population only happens when the peat-lite-frame feature is on (the codec dispatcher in [crate::peat_lite_frame] is feature-gated).

Hosts forward populated entries through their existing publish-with-origin FFI surface to plug into peat-mesh’s doc store. The body is opaque bytes — peat-btle does not interpret; consumers (peat-mesh’s transport::document_codec, peat-atak-plugin’s marker bridge, M5Stack firmware) own the body schema.

Fields§

§source_node_id: u32

Source node id from the peat-lite header. Polled hosts use this for loop-prevention and dedup tracking.

§seq_num: u32

Sequence number from the peat-lite header. Polled hosts use this to detect duplicate deliveries.

§flags: u8

Flags byte from the Document envelope (bit 0 = tombstone).

§collection: String

Collection name (UTF-8). Doc-store routing key alongside doc_id.

§doc_id: String

Document id (UTF-8). Empty signals “publisher-delegated id assignment.”

§timestamp_ms: i64

Unix epoch milliseconds.

§body: Vec<u8>

Opaque body bytes (typically JSON-encoded Document.fields from peat-mesh’s transport::document_codec).

Implementations§

Source§

impl PeatLiteDocumentFrame

Source

pub fn is_tombstone(&self) -> bool

Returns true if the deletion-tombstone flag is set.

Trait Implementations§

Source§

impl Clone for PeatLiteDocumentFrame

Source§

fn clone(&self) -> PeatLiteDocumentFrame

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PeatLiteDocumentFrame

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.