pub struct EventKey(/* private fields */);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§
Source§impl EventKey
impl EventKey
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§
impl Copy for EventKey
Source§impl<'de> Deserialize<'de> for EventKey
impl<'de> Deserialize<'de> for EventKey
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
impl Eq for EventKey
Source§impl Ord for EventKey
impl Ord for EventKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for EventKey
impl PartialOrd for EventKey
impl StructuralPartialEq for EventKey
Auto Trait Implementations§
impl Freeze for EventKey
impl RefUnwindSafe for EventKey
impl Send for EventKey
impl Sync for EventKey
impl Unpin for EventKey
impl UnsafeUnpin for EventKey
impl UnwindSafe for EventKey
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TestOnlyHash for T
impl<T> TestOnlyHash for T
Source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.