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§
§impl EventKey
impl EventKey
pub fn get_creator_address(&self) -> AccountAddress
pub fn get_creator_address(&self) -> AccountAddress
Get the account address part in this event key
pub 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`
pub fn new_from_address(addr: &AccountAddress, salt: u64) -> EventKey
pub fn new_from_address(addr: &AccountAddress, salt: u64) -> EventKey
Create a unique handle by using an AccountAddress and a counter.
pub fn from_hex<T>(hex: T) -> Result<EventKey, EventKeyParseError>where T: AsRef<[u8]>,
pub fn from_bytes<T>(bytes: T) -> Result<EventKey, EventKeyParseError>where T: AsRef<[u8]>,
Trait Implementations§
§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
.§fn arbitrary_with(
_top: <EventKey as Arbitrary>::Parameters
) -> <EventKey as Arbitrary>::Strategy
fn arbitrary_with( _top: <EventKey as Arbitrary>::Parameters ) -> <EventKey as Arbitrary>::Strategy
§impl<'de> Deserialize<'de> for EventKey
impl<'de> Deserialize<'de> for EventKey
§fn deserialize<D>(
deserializer: D
) -> Result<EventKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<EventKey, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl FromStr for EventKey
impl FromStr for EventKey
§type Err = EventKeyParseError
type Err = EventKeyParseError
The associated error which can be returned from parsing.
§impl Ord for EventKey
impl Ord for EventKey
§impl PartialOrd<EventKey> for EventKey
impl PartialOrd<EventKey> for EventKey
§fn partial_cmp(&self, other: &EventKey) -> Option<Ordering>
fn partial_cmp(&self, other: &EventKey) -> Option<Ordering>
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 more§impl Serialize for EventKey
impl Serialize for EventKey
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<&[u8]> for EventKey
impl TryFrom<&[u8]> for EventKey
§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> 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>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.