pub enum FrameMessageKind {
Publish,
Notification,
Request,
Response,
}Expand description
Semantic kind of a native uProtocol frame.
This is the native-frame vocabulary. The numeric wire codes used by frame
codecs and ABI profiles are defined by FrameMessageKind::wire_code;
the mapping to the legacy UMessageType is an explicit projection
(see FrameMessageKind::from_legacy_type).
Variants§
Publish
An event published to a topic.
Notification
A directed notification to one consumer.
Request
An RPC request.
Response
An RPC response.
Implementations§
Source§impl FrameMessageKind
impl FrameMessageKind
Sourcepub fn wire_code(self) -> u8
pub fn wire_code(self) -> u8
Gets the normative UFrame wire code of this kind.
Codes are defined by the UFrame specification: 1 = Publish,
2 = Request, 3 = Response, 4 = Notification, 0 and 5..=255 reserved.
They deliberately coincide with the legacy protobuf UMessageType
numbering so that projections are value-preserving, but the UFrame
registry is normative from here on.
Sourcepub fn from_wire_code(code: u8) -> Option<Self>
pub fn from_wire_code(code: u8) -> Option<Self>
Gets the kind denoted by a UFrame wire code.
Sourcepub fn from_legacy_type(value: UMessageType) -> Self
pub fn from_legacy_type(value: UMessageType) -> Self
Projects a legacy UMessageType to a frame message kind.
Sourcepub fn to_legacy_type(self) -> UMessageType
pub fn to_legacy_type(self) -> UMessageType
Projects this frame message kind to the legacy UMessageType.
Trait Implementations§
Source§impl Clone for FrameMessageKind
impl Clone for FrameMessageKind
Source§fn clone(&self) -> FrameMessageKind
fn clone(&self) -> FrameMessageKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more