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 Message
impl Message
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_encoded_source(&self) -> EncodedName
pub fn get_dst(&self) -> Name
pub fn get_encoded_dst(&self) -> EncodedName
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 get_ttl(&self) -> u32
pub fn set_ttl(&mut self, ttl: u32)
pub fn decrement_ttl(&mut self) -> u32
pub fn set_session_message_type(&mut self, message_type: SessionMessageType)
pub fn set_session_type(&mut self, session_type: SessionType)
pub fn get_session_type(&self) -> SessionType
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 get_link_negotiation_payload(&self) -> Option<LinkNegotiationPayload>
pub fn is_subscription_ack(&self) -> bool
pub fn is_traceable(&self) -> bool
pub fn get_subscription_ack(&self) -> &SubscriptionAck
pub fn get_subscription_id(&self) -> Option<u64>
pub fn take_subscription_id(&mut self) -> Option<u64>
pub fn set_subscription_id(&mut self, subscription_id: u64)
pub fn extract_command_payload(&self) -> Result<&CommandPayload, MessageError>
pub fn extract_discovery_request( &self, ) -> Result<&DiscoveryRequestPayload, MessageError>
pub fn extract_discovery_reply( &self, ) -> Result<&DiscoveryReplyPayload, MessageError>
pub fn extract_join_request(&self) -> Result<&JoinRequestPayload, MessageError>
pub fn extract_join_reply(&self) -> Result<&JoinReplyPayload, MessageError>
pub fn extract_leave_request( &self, ) -> Result<&LeaveRequestPayload, MessageError>
pub fn extract_leave_reply(&self) -> Result<&LeaveReplyPayload, MessageError>
pub fn extract_group_add(&self) -> Result<&GroupAddPayload, MessageError>
pub fn extract_group_remove(&self) -> Result<&GroupRemovePayload, MessageError>
pub fn extract_group_welcome( &self, ) -> Result<&GroupWelcomePayload, MessageError>
pub fn extract_group_close(&self) -> Result<&GroupClosePayload, MessageError>
pub fn extract_group_proposal( &self, ) -> Result<&GroupProposalPayload, MessageError>
pub fn extract_group_ack(&self) -> Result<&GroupAckPayload, MessageError>
pub fn extract_group_nack(&self) -> Result<&GroupNackPayload, MessageError>
pub fn extract_ping(&self) -> Result<&PingPayload, MessageError>
pub fn builder() -> ProtoMessageBuilder
Trait Implementations§
Source§impl From<Message> for Unsubscribe
impl From<Message> for Unsubscribe
Source§fn from(message: Message) -> Unsubscribe
fn from(message: Message) -> Unsubscribe
Converts to this type from the input type.
Source§impl Message for Message
impl Message for Message
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
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,
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
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,
Decodes an instance of the message from a buffer, and merges it into
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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
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
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,
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