#[non_exhaustive]pub struct EventFilter {
pub filter_type: String,
pub contract_ids: Vec<String>,
pub topics: Option<Vec<TopicFilter>>,
}Expand description
A getEvents filter. Build it with EventFilter::contract (and
EventFilter::with_topics); it is #[non_exhaustive] so new RPC filter
fields can be added without breaking downstream struct literals.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.filter_type: String§contract_ids: Vec<String>§topics: Option<Vec<TopicFilter>>Topic matchers; an event matches if any one filter matches. Omitted from
the request when None, so unfiltered queries are unchanged on the wire.
Implementations§
Source§impl EventFilter
impl EventFilter
Sourcepub fn contract<I, S>(contract_ids: I) -> Self
pub fn contract<I, S>(contract_ids: I) -> Self
Filter on contract events emitted by any of contract_ids, with no
topic matcher.
Sourcepub fn with_topics(self, topics: Vec<TopicFilter>) -> Self
pub fn with_topics(self, topics: Vec<TopicFilter>) -> Self
Restrict the filter to events matching any of topics.
Trait Implementations§
Source§impl Clone for EventFilter
impl Clone for EventFilter
Source§impl Debug for EventFilter
impl Debug for EventFilter
Source§impl<'de> Deserialize<'de> for EventFilter
impl<'de> Deserialize<'de> for EventFilter
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 EventFilter
Source§impl PartialEq for EventFilter
impl PartialEq for EventFilter
Source§impl Serialize for EventFilter
impl Serialize for EventFilter
impl StructuralPartialEq for EventFilter
Auto Trait Implementations§
impl Freeze for EventFilter
impl RefUnwindSafe for EventFilter
impl Send for EventFilter
impl Sync for EventFilter
impl Unpin for EventFilter
impl UnsafeUnpin for EventFilter
impl UnwindSafe for EventFilter
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.