Struct diem_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§
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 by
get_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§
source§impl Arbitrary for EventKey
impl Arbitrary for EventKey
§type Parameters = <[u8; 24] as Arbitrary>::Parameters
type Parameters = <[u8; 24] as Arbitrary>::Parameters
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<[u8; 24] as Arbitrary>::Strategy, fn(_: [u8; 24]) -> EventKey>
type Strategy = Map<<[u8; 24] as Arbitrary>::Strategy, fn(_: [u8; 24]) -> EventKey>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
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
source§impl FromStr for EventKey
impl FromStr for EventKey
§type Err = EventKeyParseError
type Err = EventKeyParseError
The associated error which can be returned from parsing.
source§impl Ord for EventKey
impl Ord for EventKey
source§impl PartialEq<EventKey> for EventKey
impl PartialEq<EventKey> for EventKey
source§impl PartialOrd<EventKey> for EventKey
impl PartialOrd<EventKey> for EventKey
1.0.0 · source§fn 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 moresource§impl TryFrom<&[u8]> for EventKey
impl TryFrom<&[u8]> for EventKey
source§fn 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§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.