pub struct LnmpEnvelope {
pub record: LnmpRecord,
pub metadata: EnvelopeMetadata,
}Expand description
Complete LNMP message with operational context
An envelope wraps an LNMP record with operational metadata (timestamp, source, trace_id, sequence) without affecting the record’s semantic checksum or deterministic properties.
§Example
use lnmp_core::{LnmpRecord, LnmpField, LnmpValue};
use lnmp_envelope::{LnmpEnvelope, EnvelopeMetadata};
let mut record = LnmpRecord::new();
record.add_field(LnmpField { fid: 12, value: LnmpValue::Int(14532) });
let mut metadata = EnvelopeMetadata::new();
metadata.timestamp = Some(1732373147000);
metadata.source = Some("auth-service".to_string());
let envelope = LnmpEnvelope::with_metadata(record, metadata);Fields§
§record: LnmpRecordThe LNMP record (mandatory)
metadata: EnvelopeMetadataOptional operational metadata
Implementations§
Source§impl LnmpEnvelope
impl LnmpEnvelope
Sourcepub fn new(record: LnmpRecord) -> Self
pub fn new(record: LnmpRecord) -> Self
Creates a new envelope with the given record and empty metadata
Sourcepub fn with_metadata(record: LnmpRecord, metadata: EnvelopeMetadata) -> Self
pub fn with_metadata(record: LnmpRecord, metadata: EnvelopeMetadata) -> Self
Creates a new envelope with the given record and metadata
Sourcepub fn has_metadata(&self) -> bool
pub fn has_metadata(&self) -> bool
Returns true if metadata is empty
Trait Implementations§
Source§impl Clone for LnmpEnvelope
impl Clone for LnmpEnvelope
Source§fn clone(&self) -> LnmpEnvelope
fn clone(&self) -> LnmpEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LnmpEnvelope
impl Debug for LnmpEnvelope
Source§impl PartialEq for LnmpEnvelope
impl PartialEq for LnmpEnvelope
impl StructuralPartialEq for LnmpEnvelope
Auto Trait Implementations§
impl Freeze for LnmpEnvelope
impl RefUnwindSafe for LnmpEnvelope
impl Send for LnmpEnvelope
impl Sync for LnmpEnvelope
impl Unpin for LnmpEnvelope
impl UnwindSafe for LnmpEnvelope
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