#[non_exhaustive]pub struct DocumentRef<'a> {
pub flags: u8,
pub collection: &'a str,
pub doc_id: &'a str,
pub timestamp_ms: i64,
pub body: &'a [u8],
}Expand description
Decoded view of a Document envelope, borrowing from the input
buffer. Hot-path-friendly for no_std consumers — no allocation.
Marked #[non_exhaustive] so future protocol amendments can add
fields (e.g. fragmentation sequence number) without breaking
downstream DocumentRef { ... } literal constructions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.flags: u8Flags byte. See DOC_FLAG_TOMBSTONE / DOC_FLAG_ENCRYPTED.
collection: &'a strCollection name as UTF-8 bytes (validated UTF-8 on decode).
doc_id: &'a strDocument id as UTF-8 bytes; empty slice means “publisher delegated id assignment to the receiver.”
timestamp_ms: i64Unix epoch milliseconds.
body: &'a [u8]Opaque body bytes — peat-lite does not interpret.
Implementations§
Source§impl<'a> DocumentRef<'a>
impl<'a> DocumentRef<'a>
Sourcepub fn is_tombstone(&self) -> bool
pub fn is_tombstone(&self) -> bool
Returns true if the deletion-tombstone flag is set.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Returns true if the encrypted-body flag is set.
Trait Implementations§
Source§impl<'a> Clone for DocumentRef<'a>
impl<'a> Clone for DocumentRef<'a>
Source§fn clone(&self) -> DocumentRef<'a>
fn clone(&self) -> DocumentRef<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for DocumentRef<'a>
Source§impl<'a> Debug for DocumentRef<'a>
impl<'a> Debug for DocumentRef<'a>
impl<'a> Eq for DocumentRef<'a>
Source§impl<'a> PartialEq for DocumentRef<'a>
impl<'a> PartialEq for DocumentRef<'a>
impl<'a> StructuralPartialEq for DocumentRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for DocumentRef<'a>
impl<'a> RefUnwindSafe for DocumentRef<'a>
impl<'a> Send for DocumentRef<'a>
impl<'a> Sync for DocumentRef<'a>
impl<'a> Unpin for DocumentRef<'a>
impl<'a> UnsafeUnpin for DocumentRef<'a>
impl<'a> UnwindSafe for DocumentRef<'a>
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