#[repr(C)]pub struct UFrameMetadataAbiV1 {Show 21 fields
pub magic: [u8; 4],
pub version: u8,
pub flags: u8,
pub metadata_size: u16,
pub presence: u32,
pub kind: u8,
pub priority: u8,
pub comm_status: u8,
pub _reserved0: u8,
pub ttl_ns: u64,
pub permission_level: u32,
pub _reserved1: u32,
pub id: UUuidAbi,
pub reqid: UUuidAbi,
pub payload_size: u64,
pub payload_encoding: UPayloadEncodingAbi,
pub source: UUriAbi,
pub sink: UUriAbi,
pub traceparent: UTraceparentAbi,
pub token: UTokenAbi,
pub _reserved_tail: [u8; 4],
}Expand description
Fixed-layout ABI profile v1 of native frame metadata.
size 1096, align 8, no implicit padding. A field guarded by a FIELD_*
presence bit is meaningful only when that bit is set; producers MUST
zero absent fields. payload_size is meaningful if and only if
FIELD_PAYLOAD_ENCODING is set (the v1 invariant: a frame carries
payload bytes exactly when it declares a payload encoding).
Fields§
§magic: [u8; 4]MUST equal UFRAME_ABI_MAGIC.
version: u8MUST equal UFRAME_ABI_VERSION.
flags: u8See UFRAME_ABI_FLAG_*.
metadata_size: u16MUST equal UFRAME_ABI_SIZE in v1; consumers use this to skip
trailing fields added by newer minor revisions.
presence: u32Bitwise OR of FIELD_* presence bits (shared with the canonical
field block).
kind: u8FrameMessageKind wire code (1..=4).
priority: u8FramePriority wire code; 0 = absent.
comm_status: u8UCode value; valid iff FIELD_COMM_STATUS.
_reserved0: u8MUST be zero.
ttl_ns: u64Time-to-live in nanoseconds; valid iff FIELD_TTL.
permission_level: u32Valid iff FIELD_PERMISSION_LEVEL.
_reserved1: u32MUST be zero.
id: UUuidAbiMessage id as a fixed-layout UUID.
reqid: UUuidAbiValid iff FIELD_REQID.
payload_size: u64Number of payload bytes belonging to the frame; valid iff
FIELD_PAYLOAD_ENCODING, MUST be zero otherwise.
payload_encoding: UPayloadEncodingAbiValid iff FIELD_PAYLOAD_ENCODING.
source: UUriAbiSource address as a fixed-layout URI.
sink: UUriAbiValid iff FIELD_SINK.
traceparent: UTraceparentAbiValid iff FIELD_TRACEPARENT.
token: UTokenAbiValid iff FIELD_TOKEN.
_reserved_tail: [u8; 4]MUST be zero.
Implementations§
Source§impl UFrameMetadataAbiV1
impl UFrameMetadataAbiV1
Sourcepub fn try_from_metadata(
metadata: &UFrameMetadata,
payload_size: Option<u64>,
) -> Result<Self, UFrameAbiError>
pub fn try_from_metadata( metadata: &UFrameMetadata, payload_size: Option<u64>, ) -> Result<Self, UFrameAbiError>
Converts semantic frame metadata (plus the frame’s payload size, when it carries a payload) into the fixed ABI profile.
payload_size must be Some exactly when the metadata has a payload
encoding, mirroring the frame-level invariant.
§Errors
Returns an error if the metadata is invalid, payload presence is inconsistent, or a value exceeds a profile capacity. Conversion never truncates.
Sourcepub fn try_to_metadata(
&self,
) -> Result<(UFrameMetadata, Option<u64>), UFrameAbiError>
pub fn try_to_metadata( &self, ) -> Result<(UFrameMetadata, Option<u64>), UFrameAbiError>
Converts this profile value back into semantic frame metadata plus the frame’s payload size (when the frame carries a payload).
§Errors
Returns an error if the profile value is structurally invalid or decodes into invalid metadata.
Trait Implementations§
Source§impl Clone for UFrameMetadataAbiV1
impl Clone for UFrameMetadataAbiV1
Source§fn clone(&self) -> UFrameMetadataAbiV1
fn clone(&self) -> UFrameMetadataAbiV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more