pub struct MetaCommandRecord {
pub format_version: u32,
pub command: MetaCommand,
}Expand description
The versioned envelope payload carrying one MetaCommand (spec section
4.10). Serialized as JSON into a CommandEnvelope stamped with
COMMAND_TYPE_META_COMMAND.
Fields§
§format_version: u32Format version; see META_COMMAND_FORMAT_VERSION.
command: MetaCommandThe command.
Implementations§
Source§impl MetaCommandRecord
impl MetaCommandRecord
Sourcepub fn new(command: MetaCommand) -> Self
pub fn new(command: MetaCommand) -> Self
Wraps command at the current format version.
Sourcepub fn encode(&self) -> Result<Vec<u8>, MetaError>
pub fn encode(&self) -> Result<Vec<u8>, MetaError>
Serializes the record (JSON; human-readable so 128-bit ids take their canonical hex form).
Sourcepub fn decode(payload: &[u8]) -> Result<Self, MetaDecodeError>
pub fn decode(payload: &[u8]) -> Result<Self, MetaDecodeError>
Parses and verifies a record produced by MetaCommandRecord::encode;
v1 records migrate to the canonical shapes (see the module docs).
Unknown versions and malformed payloads fail closed.
Trait Implementations§
Source§impl Clone for MetaCommandRecord
impl Clone for MetaCommandRecord
Source§fn clone(&self) -> MetaCommandRecord
fn clone(&self) -> MetaCommandRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MetaCommandRecord
impl Debug for MetaCommandRecord
Source§impl<'de> Deserialize<'de> for MetaCommandRecord
impl<'de> Deserialize<'de> for MetaCommandRecord
Source§fn 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
Source§impl PartialEq for MetaCommandRecord
impl PartialEq for MetaCommandRecord
Source§impl Serialize for MetaCommandRecord
impl Serialize for MetaCommandRecord
impl StructuralPartialEq for MetaCommandRecord
Auto Trait Implementations§
impl Freeze for MetaCommandRecord
impl RefUnwindSafe for MetaCommandRecord
impl Send for MetaCommandRecord
impl Sync for MetaCommandRecord
impl Unpin for MetaCommandRecord
impl UnsafeUnpin for MetaCommandRecord
impl UnwindSafe for MetaCommandRecord
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request