pub struct SendMessages {
pub metadata_length: u32,
pub stream_id: Identifier,
pub topic_id: Identifier,
pub partitioning: Partitioning,
pub batch: IggyMessagesBatch,
}Expand description
SendMessages command is used to send messages to a topic in a stream.
It has additional payload:
stream_id- unique stream ID (numeric or name).topic_id- unique topic ID (numeric or name).partitioning- to which partition the messages should be sent - either provided by the client or calculated by the server.batch- collection of messages to be sent.
Fields§
§metadata_length: u32Length of stream_id, topic_id, partitioning and messages_count (4 bytes)
stream_id: IdentifierUnique stream ID (numeric or name).
topic_id: IdentifierUnique topic ID (numeric or name).
partitioning: PartitioningTo which partition the messages should be sent - either provided by the client or calculated by the server.
batch: IggyMessagesBatchMessages collection
Implementations§
Source§impl SendMessages
impl SendMessages
pub fn bytes( stream_id: &Identifier, topic_id: &Identifier, partitioning: &Partitioning, messages: &[IggyMessage], ) -> Bytes
Trait Implementations§
Source§impl BytesSerializable for SendMessages
impl BytesSerializable for SendMessages
Source§fn from_bytes(_bytes: Bytes) -> Result<SendMessages, IggyError>
fn from_bytes(_bytes: Bytes) -> Result<SendMessages, IggyError>
Deserializes the struct from bytes.
Source§fn write_to_buffer(&self, _buf: &mut BytesMut)
fn write_to_buffer(&self, _buf: &mut BytesMut)
Write the struct to a buffer.
Source§fn get_buffer_size(&self) -> usize
fn get_buffer_size(&self) -> usize
Get the byte-size of the struct.
Source§impl Debug for SendMessages
impl Debug for SendMessages
Source§impl Default for SendMessages
impl Default for SendMessages
Source§impl<'de> Deserialize<'de> for SendMessages
impl<'de> Deserialize<'de> for SendMessages
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 Display for SendMessages
impl Display for SendMessages
Source§impl PartialEq for SendMessages
impl PartialEq for SendMessages
Source§impl Serialize for SendMessages
impl Serialize for SendMessages
Source§impl Validatable<IggyError> for SendMessages
impl Validatable<IggyError> for SendMessages
impl StructuralPartialEq for SendMessages
Auto Trait Implementations§
impl !Freeze for SendMessages
impl RefUnwindSafe for SendMessages
impl Send for SendMessages
impl Sync for SendMessages
impl Unpin for SendMessages
impl UnsafeUnpin for SendMessages
impl UnwindSafe for SendMessages
Blanket Implementations§
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
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 more