Struct pulsar::message::proto::MessageMetadata

source ·
pub struct MessageMetadata {
Show 28 fields pub producer_name: String, pub sequence_id: u64, pub publish_time: u64, pub properties: Vec<KeyValue>, pub replicated_from: Option<String>, pub partition_key: Option<String>, pub replicate_to: Vec<String>, pub compression: Option<i32>, pub uncompressed_size: Option<u32>, pub num_messages_in_batch: Option<i32>, pub event_time: Option<u64>, pub encryption_keys: Vec<EncryptionKeys>, pub encryption_algo: Option<String>, pub encryption_param: Option<Vec<u8>>, pub schema_version: Option<Vec<u8>>, pub partition_key_b64_encoded: Option<bool>, pub ordering_key: Option<Vec<u8>>, pub deliver_at_time: Option<i64>, pub marker_type: Option<i32>, pub txnid_least_bits: Option<u64>, pub txnid_most_bits: Option<u64>, pub highest_sequence_id: Option<u64>, pub null_value: Option<bool>, pub uuid: Option<String>, pub num_chunks_from_msg: Option<i32>, pub total_chunk_msg_size: Option<i32>, pub chunk_id: Option<i32>, pub null_partition_key: Option<bool>,
}

Fields§

§producer_name: String§sequence_id: u64§publish_time: u64§properties: Vec<KeyValue>§replicated_from: Option<String>

Property set on replicated message, includes the source cluster name

§partition_key: Option<String>

key to decide partition for the msg

§replicate_to: Vec<String>

Override namespace’s replication

§compression: Option<i32>§uncompressed_size: Option<u32>§num_messages_in_batch: Option<i32>

Removed below checksum field from Metadata as it should be part of send-command which keeps checksum of header + payload optional sfixed64 checksum = 10; differentiate single and batch message metadata

§event_time: Option<u64>

the timestamp that this event occurs. it is typically set by applications. if this field is omitted, publish_time can be used for the purpose of event_time.

§encryption_keys: Vec<EncryptionKeys>

Contains encryption key name, encrypted key and metadata to describe the key

§encryption_algo: Option<String>

Algorithm used to encrypt data key

§encryption_param: Option<Vec<u8>>

Additional parameters required by encryption

§schema_version: Option<Vec<u8>>§partition_key_b64_encoded: Option<bool>§ordering_key: Option<Vec<u8>>

Specific a key to overwrite the message key which used for ordering dispatch in Key_Shared mode.

§deliver_at_time: Option<i64>

Mark the message to be delivered at or after the specified timestamp

§marker_type: Option<i32>

Identify whether a message is a “marker” message used for internal metadata instead of application published data. Markers will generally not be propagated back to clients

§txnid_least_bits: Option<u64>

transaction related message info

§txnid_most_bits: Option<u64>§highest_sequence_id: Option<u64>

/ Add highest sequence id to support batch message with external sequence id

§null_value: Option<bool>

Indicate if the message payload value is set

§uuid: Option<String>§num_chunks_from_msg: Option<i32>§total_chunk_msg_size: Option<i32>§chunk_id: Option<i32>§null_partition_key: Option<bool>

Indicate if the message partition key is set

Implementations§

source§

impl MessageMetadata

source

pub fn replicated_from(&self) -> &str

Returns the value of replicated_from, or the default value if replicated_from is unset.

source

pub fn partition_key(&self) -> &str

Returns the value of partition_key, or the default value if partition_key is unset.

source

pub fn compression(&self) -> CompressionType

Returns the enum value of compression, or the default if the field is unset or set to an invalid enum value.

source

pub fn set_compression(&mut self, value: CompressionType)

Sets compression to the provided enum value.

source

pub fn uncompressed_size(&self) -> u32

Returns the value of uncompressed_size, or the default value if uncompressed_size is unset.

source

pub fn num_messages_in_batch(&self) -> i32

Returns the value of num_messages_in_batch, or the default value if num_messages_in_batch is unset.

source

pub fn event_time(&self) -> u64

Returns the value of event_time, or the default value if event_time is unset.

source

pub fn encryption_algo(&self) -> &str

Returns the value of encryption_algo, or the default value if encryption_algo is unset.

source

pub fn encryption_param(&self) -> &[u8]

Returns the value of encryption_param, or the default value if encryption_param is unset.

source

pub fn schema_version(&self) -> &[u8]

Returns the value of schema_version, or the default value if schema_version is unset.

source

pub fn partition_key_b64_encoded(&self) -> bool

Returns the value of partition_key_b64_encoded, or the default value if partition_key_b64_encoded is unset.

source

pub fn ordering_key(&self) -> &[u8]

Returns the value of ordering_key, or the default value if ordering_key is unset.

source

pub fn deliver_at_time(&self) -> i64

Returns the value of deliver_at_time, or the default value if deliver_at_time is unset.

source

pub fn marker_type(&self) -> i32

Returns the value of marker_type, or the default value if marker_type is unset.

source

pub fn txnid_least_bits(&self) -> u64

Returns the value of txnid_least_bits, or the default value if txnid_least_bits is unset.

source

pub fn txnid_most_bits(&self) -> u64

Returns the value of txnid_most_bits, or the default value if txnid_most_bits is unset.

source

pub fn highest_sequence_id(&self) -> u64

Returns the value of highest_sequence_id, or the default value if highest_sequence_id is unset.

source

pub fn null_value(&self) -> bool

Returns the value of null_value, or the default value if null_value is unset.

source

pub fn uuid(&self) -> &str

Returns the value of uuid, or the default value if uuid is unset.

source

pub fn num_chunks_from_msg(&self) -> i32

Returns the value of num_chunks_from_msg, or the default value if num_chunks_from_msg is unset.

source

pub fn total_chunk_msg_size(&self) -> i32

Returns the value of total_chunk_msg_size, or the default value if total_chunk_msg_size is unset.

source

pub fn chunk_id(&self) -> i32

Returns the value of chunk_id, or the default value if chunk_id is unset.

source

pub fn null_partition_key(&self) -> bool

Returns the value of null_partition_key, or the default value if null_partition_key is unset.

Trait Implementations§

source§

impl Clone for MessageMetadata

source§

fn clone(&self) -> MessageMetadata

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageMetadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MessageMetadata

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for MessageMetadata

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, 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,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for MessageMetadata

source§

fn eq(&self, other: &MessageMetadata) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for MessageMetadata

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more