Skip to main content

DaemonFrame

Struct DaemonFrame 

Source
pub struct DaemonFrame { /* private fields */ }
Expand description

A canonical frozen v1 daemon envelope.

kind and payload_encoding intentionally stay raw discriminants. This preserves unknown additive values rather than normalizing them through a backend enum. W3C trace headers are retained privately so decode followed by encode keeps their original bytes; Self::trace_id and Self::span_id expose their semantic IDs when present.

Implementations§

Source§

impl DaemonFrame

Source

pub fn request(payload_protocol: u32, payload: Vec<u8>) -> Self

Create a request with the frozen v1 defaults.

Source

pub fn response_to(request: &Self, payload: Vec<u8>) -> Self

Create the frozen response to request.

This uses the shared v1 response constructor, preserving the request correlation ID, product protocol, and W3C trace headers exactly.

Source

pub fn with_request_id(self, request_id: u64) -> Self

Set the opaque request/response correlation identifier.

Source

pub fn with_raw_kind(self, kind: i32) -> Self

Set the raw frozen frame-kind discriminant.

Source

pub fn with_raw_payload_encoding(self, payload_encoding: i32) -> Self

Set the raw frozen payload-encoding discriminant.

Source

pub fn with_deadline_unix_ms(self, deadline_unix_ms: u64) -> Self

Set the absolute Unix-millisecond deadline carried in the envelope.

Source

pub fn with_trace_context( self, trace_id: impl AsRef<str>, span_id: impl AsRef<str>, ) -> Self

Set W3C trace and span identifiers using frozen v1 trace-header form.

The default W3C version and sampled flag preserve the product’s existing v1 constructor behavior. Decoded headers are not regenerated, so an existing header’s version, flags, and formatting remain intact.

Source

pub fn with_trace_state(self, trace_state: impl Into<String>) -> Self

Set the opaque W3C trace-state value.

Source

pub fn envelope_version(&self) -> u32

Frozen envelope version carried inside the protobuf body.

Source

pub fn kind(&self) -> i32

Raw frozen frame-kind discriminant.

Source

pub fn kind_classification(&self) -> DaemonFrameKind

Classify Self::kind without discarding an unknown raw value.

Source

pub fn payload_protocol(&self) -> u32

Application-owned payload protocol identifier.

Source

pub fn payload(&self) -> &[u8] ⓘ

Opaque application payload bytes.

Source

pub fn request_id(&self) -> u64

Correlation identifier carried by the envelope.

Source

pub fn payload_encoding(&self) -> i32

Raw frozen payload-encoding discriminant.

Source

pub fn payload_encoding_classification(&self) -> DaemonPayloadEncoding

Classify Self::payload_encoding without discarding an unknown raw value.

Source

pub fn deadline_unix_ms(&self) -> u64

Absolute Unix-millisecond deadline carried by the envelope.

Source

pub fn trace_id(&self) -> Option<&str>

W3C trace ID, when the retained trace header carries one.

Source

pub fn span_id(&self) -> Option<&str>

W3C span ID, when the retained trace header carries one.

Source

pub fn trace_state(&self) -> &str

Opaque W3C trace-state retained by the envelope.

Trait Implementations§

Source§

impl Clone for DaemonFrame

Source§

fn clone(&self) -> Self

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 DaemonFrame

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for DaemonFrame

Source§

impl PartialEq for DaemonFrame

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DaemonFrame

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> Downcast for T
where T: Any,

Source§

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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

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> 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> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
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.