Struct aptos_types::event::EventKey
source · [−]pub struct EventKey(_);Expand description
A struct that represents a globally unique id for an Event stream that a user can listen to. By design, the lower part of EventKey is the same as account address.
Implementations
sourceimpl EventKey
impl EventKey
sourcepub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Get the byte representation of the event key.
sourcepub fn to_vec(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_vec(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert event key into a byte array.
sourcepub fn get_creator_address(&self) -> AccountAddress
pub fn get_creator_address(&self) -> AccountAddress
Get the account address part in this event key
sourcepub fn get_creation_number(&self) -> u64
pub fn get_creation_number(&self) -> u64
If this is the ith EventKeycreated byget_creator_address(), return i`
sourcepub fn new_from_address(addr: &AccountAddress, salt: u64) -> Self
pub fn new_from_address(addr: &AccountAddress, salt: u64) -> Self
Create a unique handle by using an AccountAddress and a counter.
pub fn from_hex<T: AsRef<[u8]>>(hex: T) -> Result<Self, EventKeyParseError>
pub fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, EventKeyParseError>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for EventKey
impl<'de> Deserialize<'de> for EventKey
sourcefn 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
sourceimpl FromStr for EventKey
impl FromStr for EventKey
type Err = EventKeyParseError
type Err = EventKeyParseError
The associated error which can be returned from parsing.
sourceimpl Ord for EventKey
impl Ord for EventKey
sourceimpl PartialOrd<EventKey> for EventKey
impl PartialOrd<EventKey> for EventKey
sourcefn partial_cmp(&self, other: &EventKey) -> Option<Ordering>
fn partial_cmp(&self, other: &EventKey) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl TryFrom<&[u8]> for EventKey
impl TryFrom<&[u8]> for EventKey
sourcefn try_from(bytes: &[u8]) -> Result<EventKey, EventKeyParseError>
fn try_from(bytes: &[u8]) -> Result<EventKey, EventKeyParseError>
Tries to convert the provided byte array into Event Key.
type Error = EventKeyParseError
type Error = EventKeyParseError
The type returned in the event of a conversion error.
impl Copy for EventKey
impl Eq for EventKey
impl StructuralEq for EventKey
impl StructuralPartialEq for EventKey
Auto Trait Implementations
impl RefUnwindSafe for EventKey
impl Send for EventKey
impl Sync for EventKey
impl Unpin for EventKey
impl UnwindSafe for EventKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
sourcefn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more