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
impl DaemonFrame
Sourcepub fn request(payload_protocol: u32, payload: Vec<u8>) -> Self
pub fn request(payload_protocol: u32, payload: Vec<u8>) -> Self
Create a request with the frozen v1 defaults.
Sourcepub fn response_to(request: &Self, payload: Vec<u8>) -> Self
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.
Sourcepub fn with_request_id(self, request_id: u64) -> Self
pub fn with_request_id(self, request_id: u64) -> Self
Set the opaque request/response correlation identifier.
Sourcepub fn with_raw_kind(self, kind: i32) -> Self
pub fn with_raw_kind(self, kind: i32) -> Self
Set the raw frozen frame-kind discriminant.
Sourcepub fn with_raw_payload_encoding(self, payload_encoding: i32) -> Self
pub fn with_raw_payload_encoding(self, payload_encoding: i32) -> Self
Set the raw frozen payload-encoding discriminant.
Sourcepub fn with_deadline_unix_ms(self, deadline_unix_ms: u64) -> Self
pub fn with_deadline_unix_ms(self, deadline_unix_ms: u64) -> Self
Set the absolute Unix-millisecond deadline carried in the envelope.
Sourcepub fn with_trace_context(
self,
trace_id: impl AsRef<str>,
span_id: impl AsRef<str>,
) -> Self
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.
Sourcepub fn with_trace_state(self, trace_state: impl Into<String>) -> Self
pub fn with_trace_state(self, trace_state: impl Into<String>) -> Self
Set the opaque W3C trace-state value.
Sourcepub fn envelope_version(&self) -> u32
pub fn envelope_version(&self) -> u32
Frozen envelope version carried inside the protobuf body.
Sourcepub fn kind_classification(&self) -> DaemonFrameKind
pub fn kind_classification(&self) -> DaemonFrameKind
Classify Self::kind without discarding an unknown raw value.
Sourcepub fn payload_protocol(&self) -> u32
pub fn payload_protocol(&self) -> u32
Application-owned payload protocol identifier.
Sourcepub fn request_id(&self) -> u64
pub fn request_id(&self) -> u64
Correlation identifier carried by the envelope.
Sourcepub fn payload_encoding(&self) -> i32
pub fn payload_encoding(&self) -> i32
Raw frozen payload-encoding discriminant.
Sourcepub fn payload_encoding_classification(&self) -> DaemonPayloadEncoding
pub fn payload_encoding_classification(&self) -> DaemonPayloadEncoding
Classify Self::payload_encoding without discarding an unknown raw value.
Sourcepub fn deadline_unix_ms(&self) -> u64
pub fn deadline_unix_ms(&self) -> u64
Absolute Unix-millisecond deadline carried by the envelope.
Sourcepub fn trace_id(&self) -> Option<&str>
pub fn trace_id(&self) -> Option<&str>
W3C trace ID, when the retained trace header carries one.
Sourcepub fn trace_state(&self) -> &str
pub fn trace_state(&self) -> &str
Opaque W3C trace-state retained by the envelope.
Trait Implementations§
Source§impl Clone for DaemonFrame
impl Clone for DaemonFrame
Source§impl Debug for DaemonFrame
impl Debug for DaemonFrame
impl Eq for DaemonFrame
Source§impl PartialEq for DaemonFrame
impl PartialEq for DaemonFrame
impl StructuralPartialEq for DaemonFrame
Auto Trait Implementations§
impl Freeze for DaemonFrame
impl RefUnwindSafe for DaemonFrame
impl Send for DaemonFrame
impl Sync for DaemonFrame
impl Unpin for DaemonFrame
impl UnsafeUnpin for DaemonFrame
impl UnwindSafe for DaemonFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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