pub struct Message { /* private fields */ }Expand description
Message that was emitted by an addressable entity during execution.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(
source: EntityAddr,
message: MessagePayload,
topic_name: String,
topic_name_hash: TopicNameHash,
topic_index: u32,
block_index: u64,
) -> Self
pub fn new( source: EntityAddr, message: MessagePayload, topic_name: String, topic_name_hash: TopicNameHash, topic_index: u32, block_index: u64, ) -> Self
Creates new instance of Message with the specified source and message payload.
Sourcepub fn entity_addr(&self) -> &EntityAddr
pub fn entity_addr(&self) -> &EntityAddr
Returns a reference to the identity of the entity that produced the message.
Sourcepub fn payload(&self) -> &MessagePayload
pub fn payload(&self) -> &MessagePayload
Returns a reference to the payload of the message.
Sourcepub fn topic_name(&self) -> &str
pub fn topic_name(&self) -> &str
Returns a reference to the name of the topic on which the message was emitted on.
Sourcepub fn topic_name_hash(&self) -> &TopicNameHash
pub fn topic_name_hash(&self) -> &TopicNameHash
Returns a reference to the hash of the name of the topic.
Sourcepub fn topic_index(&self) -> u32
pub fn topic_index(&self) -> u32
Returns the index of the message in the topic.
Sourcepub fn block_index(&self) -> u64
pub fn block_index(&self) -> u64
Returns the index of the message relative to other messages emitted in the block.
Sourcepub fn message_key(&self) -> Key
pub fn message_key(&self) -> Key
Returns a new Key::Message based on the information in the message.
This key can be used to query the checksum record for the message in global state.
Sourcepub fn topic_key(&self) -> Key
pub fn topic_key(&self) -> Key
Returns a new Key::Message based on the information in the message.
This key can be used to query the control record for the topic of this message in global
state.
Sourcepub fn checksum(&self) -> Result<MessageChecksum, Error>
pub fn checksum(&self) -> Result<MessageChecksum, Error>
Returns the checksum of the message.
Trait Implementations§
Source§impl DataSize for Message
impl DataSize for Message
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl<'de> Deserialize<'de> for Message
Available on crate feature std only.
impl<'de> Deserialize<'de> for Message
std only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Distribution<Message> for Standard
Available on crate feature testing only.
impl Distribution<Message> for Standard
testing only.Source§impl JsonSchema for Message
impl JsonSchema for Message
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl ToBytes for Message
impl ToBytes for Message
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Vec<u8> which would be returned from a successful call to
to_bytes() or into_bytes(). The data is not actually serialized, so this call is
relatively cheap.impl Eq for Message
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 UnwindSafe for Message
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more