pub struct Predicate { /* private fields */ }Expand description
Represents the predicates set by a subscriber to match the Subscription to an event.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn new_with_event_account(
topic: impl Into<String>,
event_account: Pubkey,
) -> Self
pub fn new_with_event_account( topic: impl Into<String>, event_account: Pubkey, ) -> Self
Sourcepub fn new_with_optional_event_account(
topic: impl Into<String>,
event_account: Option<Pubkey>,
) -> Self
pub fn new_with_optional_event_account( topic: impl Into<String>, event_account: Option<Pubkey>, ) -> Self
Sourcepub fn new_with_timestamp_range(range: Range<u64>) -> Self
pub fn new_with_timestamp_range(range: Range<u64>) -> Self
Create a new predicate for a timestamp range.
The topic is set to the clock topic and the event account is set to the clock sysvar account.
§Arguments
range- A range representing the timestamp range in milliseconds. The start is inclusive, and the end is exclusive.
§Returns
Predicate- A new instance ofPredicate
Sourcepub fn event_account(&self) -> Option<Pubkey>
pub fn event_account(&self) -> Option<Pubkey>
Get the event account of the predicate, if any.
Sourcepub fn timestamp_range(&self) -> Option<TimestampRange>
pub fn timestamp_range(&self) -> Option<TimestampRange>
Get the timestamp range of the predicate, if any.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Predicate
impl<'de> Deserialize<'de> for Predicate
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 Predicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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
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
Compare self to
key and return true if they are equal.