pub struct Precompiles { /* private fields */ }
Implementations§
Source§impl Precompiles
impl Precompiles
Sourcepub fn new(spec: PrecompileSpecId) -> &'static Self
pub fn new(spec: PrecompileSpecId) -> &'static Self
Returns the precompiles for the given spec.
Sourcepub fn inner(&self) -> &HashMap<Address, PrecompileFn>
pub fn inner(&self) -> &HashMap<Address, PrecompileFn>
Returns inner HashMap of precompiles.
Sourcepub fn cancun() -> &'static Self
pub fn cancun() -> &'static Self
Returns precompiles for Cancun spec.
If the c-kzg
feature is not enabled KZG Point Evaluation precompile will not be included,
effectively making this the same as Berlin.
Sourcepub fn addresses(&self) -> impl ExactSizeIterator<Item = &Address>
pub fn addresses(&self) -> impl ExactSizeIterator<Item = &Address>
Returns an iterator over the precompiles addresses.
Sourcepub fn into_addresses(self) -> impl ExactSizeIterator<Item = Address>
pub fn into_addresses(self) -> impl ExactSizeIterator<Item = Address>
Consumes the type and returns all precompile addresses.
Sourcepub fn get(&self, address: &Address) -> Option<&PrecompileFn>
pub fn get(&self, address: &Address) -> Option<&PrecompileFn>
Returns the precompile for the given address.
Sourcepub fn get_mut(&mut self, address: &Address) -> Option<&mut PrecompileFn>
pub fn get_mut(&mut self, address: &Address) -> Option<&mut PrecompileFn>
Returns the precompile for the given address.
Sourcepub fn addresses_set(&self) -> &HashSet<Address>
pub fn addresses_set(&self) -> &HashSet<Address>
Returns the precompiles addresses as a set.
Sourcepub fn extend(&mut self, other: impl IntoIterator<Item = PrecompileWithAddress>)
pub fn extend(&mut self, other: impl IntoIterator<Item = PrecompileWithAddress>)
Extends the precompiles with the given precompiles.
Other precompiles with overwrite existing precompiles.
Sourcepub fn difference(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
Returns complement of other
in self
.
Two entries are considered equal if the precompile addresses are equal.
Sourcepub fn intersection(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
Returns intersection of self
and other
.
Two entries are considered equal if the precompile addresses are equal.
Trait Implementations§
Source§impl Clone for Precompiles
impl Clone for Precompiles
Source§fn clone(&self) -> Precompiles
fn clone(&self) -> Precompiles
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Precompiles
impl Debug for Precompiles
Source§impl Default for Precompiles
impl Default for Precompiles
Source§fn default() -> Precompiles
fn default() -> Precompiles
Auto Trait Implementations§
impl Freeze for Precompiles
impl RefUnwindSafe for Precompiles
impl Send for Precompiles
impl Sync for Precompiles
impl Unpin for Precompiles
impl UnwindSafe for Precompiles
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more