Type Alias Topic

pub type Topic = FilterSet<FixedBytes<32>>;
Available on crate feature rpc only.
Expand description

A single topic

Aliased Type§

struct Topic(/* private fields */);

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 40 bytes

Implementations

§

impl<T> FilterSet<T>
where T: Clone + Eq + Hash,

pub fn to_value_or_array(&self) -> Option<ValueOrArray<T>>

Returns a ValueOrArray inside an Option, so that:

  • If the filter is empty, it returns None
  • If the filter has only 1 value, it returns the single value
  • Otherwise it returns an array of values
§

impl<T> FilterSet<T>
where T: Eq + Hash,

pub fn is_empty(&self) -> bool

Returns whether the filter is empty

pub fn matches(&self, value: &T) -> bool

Returns whether the given value matches the filter. It the filter is empty any value matches. Otherwise, the filter must include the value

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the underlying HashSet. Values are visited in an arbitrary order.

§

impl<T> FilterSet<T>
where T: AsRef<[u8]> + Eq + Hash,

pub fn to_bloom_filter(&self) -> BloomFilter

Returns a list of Bloom (BloomFilter) corresponding to the filter’s values

Trait Implementations

§

impl<T> Clone for FilterSet<T>
where T: Clone + Eq + Hash,

§

fn clone(&self) -> FilterSet<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> Debug for FilterSet<T>
where T: Debug + Eq + Hash,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<T> Default for FilterSet<T>
where T: Default + Eq + Hash,

§

fn default() -> FilterSet<T>

Returns the “default value” for a type. Read more
§

impl<'de, T> Deserialize<'de> for FilterSet<T>
where T: Eq + Hash + Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<FilterSet<T>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<T> From<T> for FilterSet<T>
where T: Eq + Hash,

§

fn from(src: T) -> FilterSet<T>

Converts to this type from the input type.
§

impl From<Uint<256, 4>> for FilterSet<FixedBytes<32>>

§

fn from(src: Uint<256, 4>) -> FilterSet<FixedBytes<32>>

Converts to this type from the input type.
§

impl<T> From<ValueOrArray<Option<T>>> for FilterSet<T>
where T: Eq + Hash,

§

fn from(src: ValueOrArray<Option<T>>) -> FilterSet<T>

Converts to this type from the input type.
§

impl<T> From<ValueOrArray<T>> for FilterSet<T>
where T: Eq + Hash,

§

fn from(src: ValueOrArray<T>) -> FilterSet<T>

Converts to this type from the input type.
§

impl<T> From<Vec<T>> for FilterSet<T>
where T: Eq + Hash,

§

fn from(src: Vec<T>) -> FilterSet<T>

Converts to this type from the input type.
§

impl<T> FromIterator<T> for FilterSet<T>
where T: Eq + Hash,

§

fn from_iter<I>(iter: I) -> FilterSet<T>
where I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
§

impl<T> Hash for FilterSet<T>
where T: Eq + Hash,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> IntoIterator for FilterSet<T>
where T: Eq + Hash,

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <FilterSet<T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl<T> PartialEq for FilterSet<T>
where T: PartialEq + Eq + Hash,

§

fn eq(&self, other: &FilterSet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T> Eq for FilterSet<T>
where T: Eq + Hash,

§

impl<T> StructuralPartialEq for FilterSet<T>
where T: Eq + Hash,