pub struct ProtoMessage {
pub metadata: HashMap<String, String>,
pub message_type: Option<MessageType>,
}Fields§
§metadata: HashMap<String, String>§message_type: Option<MessageType>Implementations§
Source§impl ProtoMessage
impl ProtoMessage
pub fn validate(&self) -> Result<(), MessageError>
pub fn insert_metadata(&mut self, key: String, val: String)
pub fn remove_metadata(&mut self, key: &str) -> Option<String>
pub fn contains_metadata(&self, key: &str) -> bool
pub fn get_metadata(&self, key: &str) -> Option<&String>
pub fn get_metadata_map(&self) -> HashMap<String, String>
pub fn set_metadata_map(&mut self, map: HashMap<String, String>)
pub fn get_slim_header(&self) -> &SlimHeader
pub fn get_slim_header_mut(&mut self) -> &mut SlimHeader
pub fn try_get_slim_header(&self) -> Option<&SlimHeader>
pub fn get_session_header(&self) -> &SessionHeader
pub fn get_session_header_mut(&mut self) -> &mut SessionHeader
pub fn try_get_session_header(&self) -> Option<&SessionHeader>
pub fn try_get_session_header_mut(&mut self) -> Option<&mut SessionHeader>
pub fn get_id(&self) -> u32
pub fn get_source(&self) -> Name
pub fn get_dst(&self) -> Name
pub fn get_identity(&self) -> String
pub fn get_fanout(&self) -> u32
pub fn get_recv_from(&self) -> Option<u64>
pub fn get_forward_to(&self) -> Option<u64>
pub fn get_error(&self) -> Option<bool>
pub fn get_incoming_conn(&self) -> u64
pub fn try_get_incoming_conn(&self) -> Option<u64>
pub fn get_type(&self) -> &MessageType
pub fn get_payload(&self) -> Option<&Content>
pub fn set_payload(&mut self, payload: Content)
pub fn get_session_message_type(&self) -> SessionMessageType
pub fn clear_slim_header(&mut self)
pub fn set_recv_from(&mut self, recv_from: Option<u64>)
pub fn set_forward_to(&mut self, forward_to: Option<u64>)
pub fn set_error(&mut self, error: Option<bool>)
pub fn set_fanout(&mut self, fanout: u32)
pub fn set_incoming_conn(&mut self, incoming_conn: Option<u64>)
pub fn set_error_flag(&mut self, error: Option<bool>)
pub fn set_session_message_type(&mut self, message_type: SessionMessageType)
pub fn set_session_type(&mut self, session_type: ProtoSessionType)
pub fn get_session_type(&self) -> ProtoSessionType
pub fn set_message_id(&mut self, message_id: u32)
pub fn is_publish(&self) -> bool
pub fn is_subscribe(&self) -> bool
pub fn is_unsubscribe(&self) -> bool
pub fn is_link(&self) -> bool
pub fn is_subscription_ack(&self) -> bool
pub fn is_traceable(&self) -> bool
pub fn get_subscription_ack(&self) -> &ProtoSubscriptionAck
Sourcepub fn get_subscription_id(&self) -> Option<u64>
pub fn get_subscription_id(&self) -> Option<u64>
Returns the subscription_id from a Subscribe/Unsubscribe message, or None if absent/zero.
Sourcepub fn take_subscription_id(&mut self) -> Option<u64>
pub fn take_subscription_id(&mut self) -> Option<u64>
Takes and clears the subscription_id from a Subscribe/Unsubscribe message. Returns None if the field is absent or zero.
Sourcepub fn set_subscription_id(&mut self, subscription_id: u64)
pub fn set_subscription_id(&mut self, subscription_id: u64)
Sets the subscription_id on a Subscribe/Unsubscribe message (no-op for other types).
Sourcepub fn extract_command_payload(&self) -> Result<&CommandPayload, MessageError>
pub fn extract_command_payload(&self) -> Result<&CommandPayload, MessageError>
Extracts the command payload from the message.
§Errors
Returns MessageError if the payload is missing or cannot be converted.
Sourcepub fn extract_discovery_request(
&self,
) -> Result<&DiscoveryRequestPayload, MessageError>
pub fn extract_discovery_request( &self, ) -> Result<&DiscoveryRequestPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_discovery_reply(
&self,
) -> Result<&DiscoveryReplyPayload, MessageError>
pub fn extract_discovery_reply( &self, ) -> Result<&DiscoveryReplyPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_join_request(&self) -> Result<&JoinRequestPayload, MessageError>
pub fn extract_join_request(&self) -> Result<&JoinRequestPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_join_reply(&self) -> Result<&JoinReplyPayload, MessageError>
pub fn extract_join_reply(&self) -> Result<&JoinReplyPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_leave_request(
&self,
) -> Result<&LeaveRequestPayload, MessageError>
pub fn extract_leave_request( &self, ) -> Result<&LeaveRequestPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_leave_reply(&self) -> Result<&LeaveReplyPayload, MessageError>
pub fn extract_leave_reply(&self) -> Result<&LeaveReplyPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_add(&self) -> Result<&GroupAddPayload, MessageError>
pub fn extract_group_add(&self) -> Result<&GroupAddPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_remove(&self) -> Result<&GroupRemovePayload, MessageError>
pub fn extract_group_remove(&self) -> Result<&GroupRemovePayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_welcome(
&self,
) -> Result<&GroupWelcomePayload, MessageError>
pub fn extract_group_welcome( &self, ) -> Result<&GroupWelcomePayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_close(&self) -> Result<&GroupClosePayload, MessageError>
pub fn extract_group_close(&self) -> Result<&GroupClosePayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_proposal(
&self,
) -> Result<&GroupProposalPayload, MessageError>
pub fn extract_group_proposal( &self, ) -> Result<&GroupProposalPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_ack(&self) -> Result<&GroupAckPayload, MessageError>
pub fn extract_group_ack(&self) -> Result<&GroupAckPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_group_nack(&self) -> Result<&GroupNackPayload, MessageError>
pub fn extract_group_nack(&self) -> Result<&GroupNackPayload, MessageError>
Extracts a specific command payload from the message.
Sourcepub fn extract_ping(&self) -> Result<&PingPayload, MessageError>
pub fn extract_ping(&self) -> Result<&PingPayload, MessageError>
Extracts a specific command payload from the message.
Source§impl ProtoMessage
impl ProtoMessage
Sourcepub fn builder() -> ProtoMessageBuilder
pub fn builder() -> ProtoMessageBuilder
Creates a new builder for ProtoMessage
Trait Implementations§
Source§impl AsRef<Publish> for ProtoMessage
impl AsRef<Publish> for ProtoMessage
Source§fn as_ref(&self) -> &ProtoPublish
fn as_ref(&self) -> &ProtoPublish
Source§impl From<Message> for ProtoPublish
From ProtoMessage to ProtoPublish
impl From<Message> for ProtoPublish
From ProtoMessage to ProtoPublish
Source§fn from(message: ProtoMessage) -> Self
fn from(message: ProtoMessage) -> Self
Source§impl From<Message> for ProtoSubscribe
From ProtoMessage to ProtoSubscribe
impl From<Message> for ProtoSubscribe
From ProtoMessage to ProtoSubscribe
Source§fn from(message: ProtoMessage) -> Self
fn from(message: ProtoMessage) -> Self
Source§impl From<Message> for ProtoUnsubscribe
From ProtoMessage to ProtoUnsubscribe
impl From<Message> for ProtoUnsubscribe
From ProtoMessage to ProtoUnsubscribe
Source§fn from(message: ProtoMessage) -> Self
fn from(message: ProtoMessage) -> Self
Source§impl Message for Message
impl Message for Message
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
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 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>
T in a tonic::Request