Struct ockam::OckamMessage
source · [−]#[non_exhaustive]pub struct OckamMessage {
pub data: Vec<u8>,
pub scope: Vec<Vec<u8>>,
pub generic: Option<Metadata>,
}
Expand description
A message metadata wrapper type
This message wraps around a well-typed Message type, with additional metadata. Metadata is split between the “scope” and “generic” sections.
Scope metadata
This metadata is passed around in a particular metadata scope.
For example, a worker that adds some behaviour to message sending
may chose to embed “scope” metadata. When wrapping this message
in another scope the previously scoped metadata becomes part of
the opaque data
section.
Thus it is not possible to retrieve metadata from a different nested scope!
Generic metadata
When creating an OckamMessage
it’s also possible to attach
generic metadata. This data is passed around for every nested
scope and must be re-attached to the outest-most scope when
peeling a nested message stack.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.data: Vec<u8>
Main data section of this message
scope: Vec<Vec<u8>>
Metadata for this specific scope
generic: Option<Metadata>
Metadata that is carried to the final recipient of the message
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for OckamMessage
impl<'de> Deserialize<'de> for OckamMessage
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for OckamMessage
impl Serialize for OckamMessage
impl Message for OckamMessage
Auto Trait Implementations
impl RefUnwindSafe for OckamMessage
impl Send for OckamMessage
impl Sync for OckamMessage
impl Unpin for OckamMessage
impl UnwindSafe for OckamMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Decodable for T where
T: DeserializeOwned,
impl<T> Decodable for T where
T: DeserializeOwned,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more