Type Alias TmpDB

Source
pub type TmpDB = Arc<TempDatabase<DatabaseEnv>>;
Expand description

A shared TempDatabase used for testing

Aliased Type§

struct TmpDB { /* 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: 8 bytes

Implementations

Source§

impl<T> Arc<T>
where T: ?Sized,

1.17.0 · Source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T>

Constructs an Arc<T> from a raw pointer.

The raw pointer must have been previously returned by a call to Arc<U>::into_raw with the following requirements:

  • If U is sized, it must have the same size and alignment as T. This is trivially true if U is T.
  • If U is unsized, its data pointer must have the same size and alignment as T. This is trivially true if Arc<U> was constructed through Arc<T> and then converted to Arc<U> through an unsized coercion.

Note that if U or U’s data pointer is not T but has the same size and alignment, this is basically like transmuting references of different types. See mem::transmute for more information on what restrictions apply in this case.

The raw pointer must point to a block of memory allocated by the global allocator.

The user of from_raw has to make sure a specific value of T is only dropped once.

This function is unsafe because improper use may lead to memory unsafety, even if the returned Arc<T> is never accessed.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let x_ptr = Arc::into_raw(x);

unsafe {
    // Convert back to an `Arc` to prevent leak.
    let x = Arc::from_raw(x_ptr);
    assert_eq!(&*x, "hello");

    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
}

// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!

Convert a slice back into its original array:

use std::sync::Arc;

let x: Arc<[u32]> = Arc::new([1, 2, 3]);
let x_ptr: *const [u32] = Arc::into_raw(x);

unsafe {
    let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
    assert_eq!(&*x, &[1, 2, 3]);
}
1.51.0 · Source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method, and ptr must point to a block of memory allocated by the global allocator.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count(ptr);

    // This assertion is deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw(ptr);
    assert_eq!(2, Arc::strong_count(&five));
}
1.51.0 · Source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method, and ptr must point to a block of memory allocated by the global allocator. This method can be used to release the final Arc and backing storage, but should not be called after the final Arc has been released.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count(ptr);

    // Those assertions are deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw(ptr);
    assert_eq!(2, Arc::strong_count(&five));
    Arc::decrement_strong_count(ptr);
    assert_eq!(1, Arc::strong_count(&five));
}
Source§

impl<T> Arc<T>

1.0.0 · Source

pub fn new(data: T) -> Arc<T>

Constructs a new Arc<T>.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
1.60.0 · Source

pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
where F: FnOnce(&Weak<T>) -> T,

Constructs a new Arc<T> while giving you a Weak<T> to the allocation, to allow you to construct a T which holds a weak pointer to itself.

Generally, a structure circularly referencing itself, either directly or indirectly, should not hold a strong reference to itself to prevent a memory leak. Using this function, you get access to the weak pointer during the initialization of T, before the Arc<T> is created, such that you can clone and store it inside the T.

new_cyclic first allocates the managed allocation for the Arc<T>, then calls your closure, giving it a Weak<T> to this allocation, and only afterwards completes the construction of the Arc<T> by placing the T returned from your closure into the allocation.

Since the new Arc<T> is not fully-constructed until Arc<T>::new_cyclic returns, calling upgrade on the weak reference inside your closure will fail and result in a None value.

§Panics

If data_fn panics, the panic is propagated to the caller, and the temporary Weak<T> is dropped normally.

§Example
use std::sync::{Arc, Weak};

struct Gadget {
    me: Weak<Gadget>,
}

impl Gadget {
    /// Constructs a reference counted Gadget.
    fn new() -> Arc<Self> {
        // `me` is a `Weak<Gadget>` pointing at the new allocation of the
        // `Arc` we're constructing.
        Arc::new_cyclic(|me| {
            // Create the actual struct here.
            Gadget { me: me.clone() }
        })
    }

    /// Returns a reference counted pointer to Self.
    fn me(&self) -> Arc<Self> {
        self.me.upgrade().unwrap()
    }
}
1.82.0 · Source

pub fn new_uninit() -> Arc<MaybeUninit<T>>

Constructs a new Arc with uninitialized contents.

§Examples
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut five = Arc::<u32>::new_uninit();

// Deferred initialization:
Arc::get_mut(&mut five).unwrap().write(5);

let five = unsafe { five.assume_init() };

assert_eq!(*five, 5)
Source

pub fn new_zeroed() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_zeroed_alloc #129396)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(new_zeroed_alloc)]

use std::sync::Arc;

let zero = Arc::<u32>::new_zeroed();
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0)
1.33.0 · Source

pub fn pin(data: T) -> Pin<Arc<T>>

Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then data will be pinned in memory and unable to be moved.

Source

pub fn try_pin(data: T) -> Result<Pin<Arc<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Pin<Arc<T>>, return an error if allocation fails.

Source

pub fn try_new(data: T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc<T>, returning an error if allocation fails.

§Examples
#![feature(allocator_api)]
use std::sync::Arc;

let five = Arc::try_new(5)?;
Source

pub fn try_new_uninit() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents, returning an error if allocation fails.

§Examples
#![feature(allocator_api)]
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut five = Arc::<u32>::try_new_uninit()?;

// Deferred initialization:
Arc::get_mut(&mut five).unwrap().write(5);

let five = unsafe { five.assume_init() };

assert_eq!(*five, 5);
Source

pub fn try_new_zeroed() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, returning an error if allocation fails.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature( allocator_api)]

use std::sync::Arc;

let zero = Arc::<u32>::try_new_zeroed()?;
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0);
Source§

impl<T, A> Arc<T, A>
where A: Allocator, T: ?Sized,

Source

pub fn allocator(this: &Arc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api #32838)

Returns a reference to the underlying allocator.

Note: this is an associated function, which means that you have to call it as Arc::allocator(&a) instead of a.allocator(). This is so that there is no conflict with a method on the inner type.

1.17.0 · Source

pub fn into_raw(this: Arc<T, A>) -> *const T

Consumes the Arc, returning the wrapped pointer.

To avoid a memory leak the pointer must be converted back to an Arc using Arc::from_raw.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let x_ptr = Arc::into_raw(x);
assert_eq!(unsafe { &*x_ptr }, "hello");
Source

pub fn into_raw_with_allocator(this: Arc<T, A>) -> (*const T, A)

🔬This is a nightly-only experimental API. (allocator_api #32838)

Consumes the Arc, returning the wrapped pointer and allocator.

To avoid a memory leak the pointer must be converted back to an Arc using Arc::from_raw_in.

§Examples
#![feature(allocator_api)]
use std::sync::Arc;
use std::alloc::System;

let x = Arc::new_in("hello".to_owned(), System);
let (ptr, alloc) = Arc::into_raw_with_allocator(x);
assert_eq!(unsafe { &*ptr }, "hello");
let x = unsafe { Arc::from_raw_in(ptr, alloc) };
assert_eq!(&*x, "hello");
1.45.0 · Source

pub fn as_ptr(this: &Arc<T, A>) -> *const T

Provides a raw pointer to the data.

The counts are not affected in any way and the Arc is not consumed. The pointer is valid for as long as there are strong counts in the Arc.

§Examples
use std::sync::Arc;

let x = Arc::new("hello".to_owned());
let y = Arc::clone(&x);
let x_ptr = Arc::as_ptr(&x);
assert_eq!(x_ptr, Arc::as_ptr(&y));
assert_eq!(unsafe { &*x_ptr }, "hello");
Source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs an Arc<T, A> from a raw pointer.

The raw pointer must have been previously returned by a call to Arc<U, A>::into_raw with the following requirements:

  • If U is sized, it must have the same size and alignment as T. This is trivially true if U is T.
  • If U is unsized, its data pointer must have the same size and alignment as T. This is trivially true if Arc<U> was constructed through Arc<T> and then converted to Arc<U> through an unsized coercion.

Note that if U or U’s data pointer is not T but has the same size and alignment, this is basically like transmuting references of different types. See mem::transmute for more information on what restrictions apply in this case.

The raw pointer must point to a block of memory allocated by alloc

The user of from_raw has to make sure a specific value of T is only dropped once.

This function is unsafe because improper use may lead to memory unsafety, even if the returned Arc<T> is never accessed.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let x = Arc::new_in("hello".to_owned(), System);
let x_ptr = Arc::into_raw(x);

unsafe {
    // Convert back to an `Arc` to prevent leak.
    let x = Arc::from_raw_in(x_ptr, System);
    assert_eq!(&*x, "hello");

    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
}

// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!

Convert a slice back into its original array:

#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
let x_ptr: *const [u32] = Arc::into_raw(x);

unsafe {
    let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
    assert_eq!(&*x, &[1, 2, 3]);
}
1.4.0 · Source

pub fn downgrade(this: &Arc<T, A>) -> Weak<T, A>
where A: Clone,

Creates a new Weak pointer to this allocation.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

let weak_five = Arc::downgrade(&five);
1.15.0 · Source

pub fn weak_count(this: &Arc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

§Safety

This method by itself is safe, but using it correctly requires extra care. Another thread can change the weak count at any time, including potentially between calling this method and acting on the result.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let _weak_five = Arc::downgrade(&five);

// This assertion is deterministic because we haven't shared
// the `Arc` or `Weak` between threads.
assert_eq!(1, Arc::weak_count(&five));
1.15.0 · Source

pub fn strong_count(this: &Arc<T, A>) -> usize

Gets the number of strong (Arc) pointers to this allocation.

§Safety

This method by itself is safe, but using it correctly requires extra care. Another thread can change the strong count at any time, including potentially between calling this method and acting on the result.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let _also_five = Arc::clone(&five);

// This assertion is deterministic because we haven't shared
// the `Arc` between threads.
assert_eq!(2, Arc::strong_count(&five));
Source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where A: Clone,

🔬This is a nightly-only experimental API. (allocator_api #32838)

Increments the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method, and ptr must point to a block of memory allocated by alloc.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count_in(ptr, System);

    // This assertion is deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw_in(ptr, System);
    assert_eq!(2, Arc::strong_count(&five));
}
Source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_api #32838)

Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.

§Safety

The pointer must have been obtained through Arc::into_raw and must satisfy the same layout requirements specified in Arc::from_raw_in. The associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method, and ptr must point to a block of memory allocated by alloc. This method can be used to release the final Arc and backing storage, but should not be called after the final Arc has been released.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);

unsafe {
    let ptr = Arc::into_raw(five);
    Arc::increment_strong_count_in(ptr, System);

    // Those assertions are deterministic because we haven't shared
    // the `Arc` between threads.
    let five = Arc::from_raw_in(ptr, System);
    assert_eq!(2, Arc::strong_count(&five));
    Arc::decrement_strong_count_in(ptr, System);
    assert_eq!(1, Arc::strong_count(&five));
}
1.17.0 · Source

pub fn ptr_eq(this: &Arc<T, A>, other: &Arc<T, A>) -> bool

Returns true if the two Arcs point to the same allocation in a vein similar to ptr::eq. This function ignores the metadata of dyn Trait pointers.

§Examples
use std::sync::Arc;

let five = Arc::new(5);
let same_five = Arc::clone(&five);
let other_five = Arc::new(5);

assert!(Arc::ptr_eq(&five, &same_five));
assert!(!Arc::ptr_eq(&five, &other_five));
Source§

impl<T, A> Arc<T, A>
where T: CloneToUninit + ?Sized, A: Allocator + Clone,

1.4.0 · Source

pub fn make_mut(this: &mut Arc<T, A>) -> &mut T

Makes a mutable reference into the given Arc.

If there are other Arc pointers to the same allocation, then make_mut will clone the inner value to a new allocation to ensure unique ownership. This is also referred to as clone-on-write.

However, if there are no other Arc pointers to this allocation, but some Weak pointers, then the Weak pointers will be dissociated and the inner value will not be cloned.

See also get_mut, which will fail rather than cloning the inner value or dissociating Weak pointers.

§Examples
use std::sync::Arc;

let mut data = Arc::new(5);

*Arc::make_mut(&mut data) += 1;         // Won't clone anything
let mut other_data = Arc::clone(&data); // Won't clone inner data
*Arc::make_mut(&mut data) += 1;         // Clones inner data
*Arc::make_mut(&mut data) += 1;         // Won't clone anything
*Arc::make_mut(&mut other_data) *= 2;   // Won't clone anything

// Now `data` and `other_data` point to different allocations.
assert_eq!(*data, 8);
assert_eq!(*other_data, 12);

Weak pointers will be dissociated:

use std::sync::Arc;

let mut data = Arc::new(75);
let weak = Arc::downgrade(&data);

assert!(75 == *data);
assert!(75 == *weak.upgrade().unwrap());

*Arc::make_mut(&mut data) += 1;

assert!(76 == *data);
assert!(weak.upgrade().is_none());
Source§

impl<T, A> Arc<T, A>
where T: Clone, A: Allocator,

1.76.0 · Source

pub fn unwrap_or_clone(this: Arc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the clone.

Assuming arc_t is of type Arc<T>, this function is functionally equivalent to (*arc_t).clone(), but will avoid cloning the inner value where possible.

§Examples
let inner = String::from("test");
let ptr = inner.as_ptr();

let arc = Arc::new(inner);
let inner = Arc::unwrap_or_clone(arc);
// The inner value was not cloned
assert!(ptr::eq(ptr, inner.as_ptr()));

let arc = Arc::new(inner);
let arc2 = arc.clone();
let inner = Arc::unwrap_or_clone(arc);
// Because there were 2 references, we had to clone the inner value.
assert!(!ptr::eq(ptr, inner.as_ptr()));
// `arc2` is the last reference, so when we unwrap it we get back
// the original `String`.
let inner = Arc::unwrap_or_clone(arc2);
assert!(ptr::eq(ptr, inner.as_ptr()));
Source§

impl<T, A> Arc<T, A>
where A: Allocator, T: ?Sized,

1.4.0 · Source

pub fn get_mut(this: &mut Arc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Arc, if there are no other Arc or Weak pointers to the same allocation.

Returns None otherwise, because it is not safe to mutate a shared value.

See also make_mut, which will clone the inner value when there are other Arc pointers.

§Examples
use std::sync::Arc;

let mut x = Arc::new(3);
*Arc::get_mut(&mut x).unwrap() = 4;
assert_eq!(*x, 4);

let _y = Arc::clone(&x);
assert!(Arc::get_mut(&mut x).is_none());
Source

pub unsafe fn get_mut_unchecked(this: &mut Arc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked #63292)

Returns a mutable reference into the given Arc, without any check.

See also get_mut, which is safe and does appropriate checks.

§Safety

If any other Arc or Weak pointers to the same allocation exist, then they must not be dereferenced or have active borrows for the duration of the returned borrow, and their inner type must be exactly the same as the inner type of this Rc (including lifetimes). This is trivially the case if no such pointers exist, for example immediately after Arc::new.

§Examples
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut x = Arc::new(String::new());
unsafe {
    Arc::get_mut_unchecked(&mut x).push_str("foo")
}
assert_eq!(*x, "foo");

Other Arc pointers to the same allocation must be to the same type.

#![feature(get_mut_unchecked)]

use std::sync::Arc;

let x: Arc<str> = Arc::from("Hello, world!");
let mut y: Arc<[u8]> = x.clone().into();
unsafe {
    // this is Undefined Behavior, because x's inner type is str, not [u8]
    Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8
}
println!("{}", &*x); // Invalid UTF-8 in a str

Other Arc pointers to the same allocation must be to the exact same type, including lifetimes.

#![feature(get_mut_unchecked)]

use std::sync::Arc;

let x: Arc<&str> = Arc::new("Hello, world!");
{
    let s = String::from("Oh, no!");
    let mut y: Arc<&str> = x.clone();
    unsafe {
        // this is Undefined Behavior, because x's inner type
        // is &'long str, not &'short str
        *Arc::get_mut_unchecked(&mut y) = &s;
    }
}
println!("{}", &*x); // Use-after-free
Source§

impl<T, A> Arc<T, A>
where A: Allocator,

Source

pub fn new_in(data: T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc<T> in the provided allocator.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::new_in(5, System);
Source

pub fn new_uninit_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents in the provided allocator.

§Examples
#![feature(get_mut_unchecked)]
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let mut five = Arc::<u32, _>::new_uninit_in(System);

let five = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);

    five.assume_init()
};

assert_eq!(*five, 5)
Source

pub fn new_zeroed_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, in the provided allocator.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let zero = Arc::<u32, _>::new_zeroed_in(System);
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0)
Source

pub fn new_cyclic_in<F>(data_fn: F, alloc: A) -> Arc<T, A>
where F: FnOnce(&Weak<T, A>) -> T,

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc<T, A> in the given allocator while giving you a Weak<T, A> to the allocation, to allow you to construct a T which holds a weak pointer to itself.

Generally, a structure circularly referencing itself, either directly or indirectly, should not hold a strong reference to itself to prevent a memory leak. Using this function, you get access to the weak pointer during the initialization of T, before the Arc<T, A> is created, such that you can clone and store it inside the T.

new_cyclic_in first allocates the managed allocation for the Arc<T, A>, then calls your closure, giving it a Weak<T, A> to this allocation, and only afterwards completes the construction of the Arc<T, A> by placing the T returned from your closure into the allocation.

Since the new Arc<T, A> is not fully-constructed until Arc<T, A>::new_cyclic_in returns, calling upgrade on the weak reference inside your closure will fail and result in a None value.

§Panics

If data_fn panics, the panic is propagated to the caller, and the temporary Weak<T> is dropped normally.

§Example

See new_cyclic

Source

pub fn pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>
where A: 'static,

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Pin<Arc<T, A>> in the provided allocator. If T does not implement Unpin, then data will be pinned in memory and unable to be moved.

Source

pub fn try_pin_in(data: T, alloc: A) -> Result<Pin<Arc<T, A>>, AllocError>
where A: 'static,

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Pin<Arc<T, A>> in the provided allocator, return an error if allocation fails.

Source

pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc<T, A> in the provided allocator, returning an error if allocation fails.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let five = Arc::try_new_in(5, System)?;
Source

pub fn try_new_uninit_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents, in the provided allocator, returning an error if allocation fails.

§Examples
#![feature(allocator_api)]
#![feature(get_mut_unchecked)]

use std::sync::Arc;
use std::alloc::System;

let mut five = Arc::<u32, _>::try_new_uninit_in(System)?;

let five = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);

    five.assume_init()
};

assert_eq!(*five, 5);
Source

pub fn try_new_zeroed_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api #32838)

Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes, in the provided allocator, returning an error if allocation fails.

See MaybeUninit::zeroed for examples of correct and incorrect usage of this method.

§Examples
#![feature(allocator_api)]

use std::sync::Arc;
use std::alloc::System;

let zero = Arc::<u32, _>::try_new_zeroed_in(System)?;
let zero = unsafe { zero.assume_init() };

assert_eq!(*zero, 0);
1.4.0 · Source

pub fn try_unwrap(this: Arc<T, A>) -> Result<T, Arc<T, A>>

Returns the inner value, if the Arc has exactly one strong reference.

Otherwise, an Err is returned with the same Arc that was passed in.

This will succeed even if there are outstanding weak references.

It is strongly recommended to use Arc::into_inner instead if you don’t keep the Arc in the Err case. Immediately dropping the Err-value, as the expression Arc::try_unwrap(this).ok() does, can cause the strong count to drop to zero and the inner value of the Arc to be dropped. For instance, if two threads execute such an expression in parallel, there is a race condition without the possibility of unsafety: The threads could first both check whether they own the last instance in Arc::try_unwrap, determine that they both do not, and then both discard and drop their instance in the call to ok. In this scenario, the value inside the Arc is safely destroyed by exactly one of the threads, but neither thread will ever be able to use the value.

§Examples
use std::sync::Arc;

let x = Arc::new(3);
assert_eq!(Arc::try_unwrap(x), Ok(3));

let x = Arc::new(4);
let _y = Arc::clone(&x);
assert_eq!(*Arc::try_unwrap(x).unwrap_err(), 4);
1.70.0 · Source

pub fn into_inner(this: Arc<T, A>) -> Option<T>

Returns the inner value, if the Arc has exactly one strong reference.

Otherwise, None is returned and the Arc is dropped.

This will succeed even if there are outstanding weak references.

If Arc::into_inner is called on every clone of this Arc, it is guaranteed that exactly one of the calls returns the inner value. This means in particular that the inner value is not dropped.

Arc::try_unwrap is conceptually similar to Arc::into_inner, but it is meant for different use-cases. If used as a direct replacement for Arc::into_inner anyway, such as with the expression Arc::try_unwrap(this).ok(), then it does not give the same guarantee as described in the previous paragraph. For more information, see the examples below and read the documentation of Arc::try_unwrap.

§Examples

Minimal example demonstrating the guarantee that Arc::into_inner gives.

use std::sync::Arc;

let x = Arc::new(3);
let y = Arc::clone(&x);

// Two threads calling `Arc::into_inner` on both clones of an `Arc`:
let x_thread = std::thread::spawn(|| Arc::into_inner(x));
let y_thread = std::thread::spawn(|| Arc::into_inner(y));

let x_inner_value = x_thread.join().unwrap();
let y_inner_value = y_thread.join().unwrap();

// One of the threads is guaranteed to receive the inner value:
assert!(matches!(
    (x_inner_value, y_inner_value),
    (None, Some(3)) | (Some(3), None)
));
// The result could also be `(None, None)` if the threads called
// `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.

A more practical example demonstrating the need for Arc::into_inner:

use std::sync::Arc;

// Definition of a simple singly linked list using `Arc`:
#[derive(Clone)]
struct LinkedList<T>(Option<Arc<Node<T>>>);
struct Node<T>(T, Option<Arc<Node<T>>>);

// Dropping a long `LinkedList<T>` relying on the destructor of `Arc`
// can cause a stack overflow. To prevent this, we can provide a
// manual `Drop` implementation that does the destruction in a loop:
impl<T> Drop for LinkedList<T> {
    fn drop(&mut self) {
        let mut link = self.0.take();
        while let Some(arc_node) = link.take() {
            if let Some(Node(_value, next)) = Arc::into_inner(arc_node) {
                link = next;
            }
        }
    }
}

// Implementation of `new` and `push` omitted
impl<T> LinkedList<T> {
    /* ... */
}

// The following code could have still caused a stack overflow
// despite the manual `Drop` impl if that `Drop` impl had used
// `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.

// Create a long list and clone it
let mut x = LinkedList::new();
let size = 100000;
for i in 0..size {
    x.push(i); // Adds i to the front of x
}
let y = x.clone();

// Drop the clones in parallel
let x_thread = std::thread::spawn(|| drop(x));
let y_thread = std::thread::spawn(|| drop(y));
x_thread.join().unwrap();
y_thread.join().unwrap();

Trait Implementations

§

impl<T> AccessListItemTr for Arc<T>
where T: AccessListItemTr + ?Sized,

§

fn address(&self) -> &Address

Returns account address.
§

fn storage_slots(&self) -> impl Iterator<Item = &FixedBytes<32>>

Returns storage slot keys.
§

impl<T> AccountExtReader for Arc<T>
where T: AccountExtReader + ?Sized,

§

fn changed_accounts_with_range( &self, _range: impl RangeBounds<u64>, ) -> Result<BTreeSet<Address>, ProviderError>

Iterate over account changesets and return all account address that were changed.
§

fn basic_accounts( &self, _iter: impl IntoIterator<Item = Address>, ) -> Result<Vec<(Address, Option<Account>)>, ProviderError>

Get basic account information for multiple accounts. A more efficient version than calling [AccountReader::basic_account] repeatedly. Read more
§

fn changed_accounts_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, Vec<u64>>, ProviderError>

Iterate over account changesets and return all account addresses that were changed alongside each specific set of blocks. Read more
§

impl<T> AccountReader for Arc<T>
where T: AccountReader + ?Sized,

§

fn basic_account( &self, address: &Address, ) -> Result<Option<Account>, ProviderError>

Get basic account information. Read more
§

impl<T> BlockHeader for Arc<T>
where T: BlockHeader + ?Sized,

§

fn parent_hash(&self) -> FixedBytes<32>

Retrieves the parent hash of the block
§

fn ommers_hash(&self) -> FixedBytes<32>

Retrieves the ommers hash of the block
§

fn beneficiary(&self) -> Address

Retrieves the beneficiary (miner) of the block
§

fn state_root(&self) -> FixedBytes<32>

Retrieves the state root hash of the block
§

fn transactions_root(&self) -> FixedBytes<32>

Retrieves the transactions root hash of the block
§

fn receipts_root(&self) -> FixedBytes<32>

Retrieves the receipts root hash of the block
§

fn withdrawals_root(&self) -> Option<FixedBytes<32>>

Retrieves the withdrawals root hash of the block, if available
§

fn logs_bloom(&self) -> Bloom

Retrieves the logs bloom filter of the block
§

fn difficulty(&self) -> Uint<256, 4>

Retrieves the difficulty of the block
§

fn number(&self) -> u64

Retrieves the block number
§

fn gas_limit(&self) -> u64

Retrieves the gas limit of the block
§

fn gas_used(&self) -> u64

Retrieves the gas used by the block
§

fn timestamp(&self) -> u64

Retrieves the timestamp of the block
§

fn mix_hash(&self) -> Option<FixedBytes<32>>

Retrieves the mix hash of the block, if available
§

fn nonce(&self) -> Option<FixedBytes<8>>

Retrieves the nonce of the block, if available
§

fn base_fee_per_gas(&self) -> Option<u64>

Retrieves the base fee per gas of the block, if available
§

fn blob_gas_used(&self) -> Option<u64>

Retrieves the blob gas used by the block, if available
§

fn excess_blob_gas(&self) -> Option<u64>

Retrieves the excess blob gas of the block, if available
§

fn parent_beacon_block_root(&self) -> Option<FixedBytes<32>>

Retrieves the parent beacon block root of the block, if available
§

fn requests_hash(&self) -> Option<FixedBytes<32>>

Retrieves the requests hash of the block, if available
§

fn extra_data(&self) -> &Bytes

Retrieves the block’s extra data field
§

fn blob_fee(&self, blob_params: BlobParams) -> Option<u128>

Returns the blob fee for this block according to the EIP-4844 spec. Read more
§

fn next_block_excess_blob_gas(&self, blob_params: BlobParams) -> Option<u64>

Calculate excess blob gas for the next block according to the EIP-4844 spec. Read more
§

fn maybe_next_block_excess_blob_gas( &self, blob_params: Option<BlobParams>, ) -> Option<u64>

Convenience function for [Self::next_block_excess_blob_gas] with an optional [BlobParams] argument. Read more
§

fn next_block_blob_fee(&self, blob_params: BlobParams) -> Option<u128>

Returns the blob fee for the next block according to the EIP-4844 spec. Read more
§

fn maybe_next_block_blob_fee( &self, blob_params: Option<BlobParams>, ) -> Option<u128>

Convenience function for [Self::next_block_blob_fee] with an optional [BlobParams] argument. Read more
§

fn next_block_base_fee(&self, base_fee_params: BaseFeeParams) -> Option<u64>

Calculate base fee for next block according to the EIP-1559 spec. Read more
§

fn parent_num_hash(&self) -> NumHash

Returns the parent block’s number and hash Read more
§

fn is_empty(&self) -> bool

Checks if the header is considered empty - has no transactions, no ommers or withdrawals
§

fn is_zero_difficulty(&self) -> bool

Checks if the block’s difficulty is set to zero, indicating a Proof-of-Stake header. Read more
§

fn exceeds_allowed_future_timestamp(&self, present_timestamp: u64) -> bool

Checks if the block’s timestamp is in the future based on the present timestamp. Read more
§

fn is_nonce_zero(&self) -> bool

Checks if the nonce exists, and if it exists, if it’s zero. Read more
§

impl<T> AnyProvider for Arc<T>
where T: AnyProvider + ?Sized,

§

fn load_any( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<AnyResponse, DataError>

Loads an [AnyPayload] according to the key and request.
§

impl<'a, A> Arbitrary<'a> for Arc<A>
where A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Arc<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
§

impl<A> Arbitrary for Arc<A>
where A: Arbitrary,

§

type Parameters = <A as Arbitrary>::Parameters

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = MapInto<<A as Arbitrary>::Strategy, Arc<A>>

The type of Strategy used to generate values of type Self.
§

fn arbitrary_with( args: <Arc<A> as Arbitrary>::Parameters, ) -> <Arc<A> as Arbitrary>::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
§

impl<A> ArbitraryF1<A> for Arc<A>
where A: Debug + 'static,

§

type Parameters = ()

The type of parameters that lift1_with accepts for configuration of the lifted and generated Strategy. Parameters must implement Default.
§

fn lift1_with<S>( base: S, _args: <Arc<A> as ArbitraryF1<A>>::Parameters, ) -> BoxedStrategy<Arc<A>>
where S: Strategy<Value = A> + 'static,

Lifts a given Strategy to a new Strategy for the (presumably) bigger type. This is useful for lifting a Strategy for SomeType to a container such as Vec of SomeType. The composite strategy is passed the arguments given in args. Read more
§

fn lift1<AS>(base: AS) -> BoxedStrategy<Self>
where AS: Strategy<Value = A> + 'static,

Lifts a given Strategy to a new Strategy for the (presumably) bigger type. This is useful for lifting a Strategy for SomeType to a container such as Vec<SomeType>. Read more
1.64.0 · Source§

impl<T> AsFd for Arc<T>
where T: AsFd + ?Sized,

This impl allows implementing traits that require AsFd on Arc.

use std::net::UdpSocket;
use std::sync::Arc;

trait MyTrait: AsFd {}
impl MyTrait for Arc<UdpSocket> {}
impl MyTrait for Box<UdpSocket> {}
Source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
1.63.0 · Source§

impl<T> AsRawFd for Arc<T>
where T: AsRawFd,

This impl allows implementing traits that require AsRawFd on Arc.

use std::net::UdpSocket;
use std::sync::Arc;
trait MyTrait: AsRawFd {
}
impl MyTrait for Arc<UdpSocket> {}
impl MyTrait for Box<UdpSocket> {}
Source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
1.5.0 · Source§

impl<T, A> AsRef<T> for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<T> AuthorizationTr for Arc<T>
where T: AuthorizationTr + ?Sized,

§

fn authority(&self) -> Option<Address>

Authority address. Read more
§

fn chain_id(&self) -> Uint<256, 4>

Returns authorization the chain id.
§

fn nonce(&self) -> u64

Returns the nonce. Read more
§

fn address(&self) -> Address

Returns the address that this account is delegated to.
§

impl<T> Block for Arc<T>
where T: Block + ?Sized,

§

fn number(&self) -> u64

The number of ancestor blocks of this block (block height).
§

fn beneficiary(&self) -> Address

Beneficiary (Coinbase, miner) is a address that have signed the block. Read more
§

fn timestamp(&self) -> u64

The timestamp of the block in seconds since the UNIX epoch.
§

fn gas_limit(&self) -> u64

The gas limit of the block.
§

fn basefee(&self) -> u64

The base fee per gas, added in the London upgrade with EIP-1559.
§

fn difficulty(&self) -> Uint<256, 4>

The difficulty of the block. Read more
§

fn prevrandao(&self) -> Option<FixedBytes<32>>

The output of the randomness beacon provided by the beacon chain. Read more
§

fn blob_excess_gas_and_price(&self) -> Option<BlobExcessGasAndPrice>

Excess blob gas and blob gasprice. See also [calc_excess_blob_gas] and [calc_blob_gasprice]. Read more
§

fn blob_gasprice(&self) -> Option<u128>

See EIP-4844 and [calc_blob_gasprice]. Read more
§

fn blob_excess_gas(&self) -> Option<u64>

Return blob_excess_gas header field. See EIP-4844. Read more
§

impl<F, T> BlockAssembler<F> for Arc<T>
where F: BlockExecutorFactory, T: BlockAssembler<F> + ?Sized,

§

type Block = <T as BlockAssembler<F>>::Block

The block type produced by the assembler.
§

fn assemble_block( &self, input: BlockAssemblerInput<'_, '_, F, <<Arc<T> as BlockAssembler<F>>::Block as Block>::Header>, ) -> Result<<Arc<T> as BlockAssembler<F>>::Block, BlockExecutionError>

Builds a block. see [BlockAssemblerInput] documentation for more details.
§

impl<T> BlockBodyIndicesProvider for Arc<T>
where T: BlockBodyIndicesProvider + ?Sized, Arc<T>: Send + Sync,

§

fn block_body_indices( &self, num: u64, ) -> Result<Option<StoredBlockBodyIndices>, ProviderError>

Returns the block body indices with matching number from database. Read more
§

fn block_body_indices_range( &self, range: RangeInclusive<u64>, ) -> Result<Vec<StoredBlockBodyIndices>, ProviderError>

Returns the block body indices within the requested range matching number from storage.
§

impl<Provider, T> BlockBodyReader<Provider> for Arc<T>
where T: BlockBodyReader<Provider> + ?Sized,

§

type Block = <T as BlockBodyReader<Provider>>::Block

The block type.
§

fn read_block_bodies( &self, provider: &Provider, inputs: Vec<(&<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Header, Vec<<<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Body as BlockBody>::Transaction>)>, ) -> Result<Vec<<<Arc<T> as BlockBodyReader<Provider>>::Block as Block>::Body>, ProviderError>

Receives a list of block headers along with block transactions and returns the block bodies.
§

impl<Provider, Body, T> BlockBodyWriter<Provider, Body> for Arc<T>
where Body: BlockBody, T: BlockBodyWriter<Provider, Body> + ?Sized,

§

fn write_block_bodies( &self, provider: &Provider, bodies: Vec<(u64, Option<Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>

Writes a set of block bodies to the storage.
§

fn remove_block_bodies_above( &self, provider: &Provider, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

Removes all block bodies above the given block number from the database.
§

impl<T> BlockDownloaderProvider for Arc<T>
where T: BlockDownloaderProvider + ?Sized,

§

type Client = <T as BlockDownloaderProvider>::Client

The client this type can provide.
§

fn fetch_client( &self, ) -> impl Future<Output = Result<<Arc<T> as BlockDownloaderProvider>::Client, RecvError>> + Send

Returns a new [BlockClient], used for fetching blocks from peers. Read more
§

impl<T> BlockExecutorFactory for Arc<T>
where T: BlockExecutorFactory + ?Sized, Arc<T>: 'static,

§

type EvmFactory = <T as BlockExecutorFactory>::EvmFactory

The EVM factory used by the executor.
§

type ExecutionCtx<'a> = <T as BlockExecutorFactory>::ExecutionCtx<'a>

Context required for block execution. Read more
§

type Transaction = <T as BlockExecutorFactory>::Transaction

Transaction type used by the executor, see [BlockExecutor::Transaction].
§

type Receipt = <T as BlockExecutorFactory>::Receipt

Receipt type produced by the executor, see [BlockExecutor::Receipt].
§

fn evm_factory(&self) -> &<Arc<T> as BlockExecutorFactory>::EvmFactory

Reference to EVM factory used by the executor.
§

fn create_executor<'a, DB, I>( &'a self, evm: <<Arc<T> as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>, ctx: <Arc<T> as BlockExecutorFactory>::ExecutionCtx<'a>, ) -> impl BlockExecutorFor<'a, Arc<T>, DB, I>
where DB: Database + 'a, I: Inspector<<<Arc<T> as BlockExecutorFactory>::EvmFactory as EvmFactory>::Context<&'a mut State<DB>>> + 'a,

Creates an executor with given EVM and execution context.
§

impl<T> BlockHashReader for Arc<T>
where T: BlockHashReader + ?Sized, Arc<T>: Send + Sync,

§

fn block_hash( &self, number: u64, ) -> Result<Option<FixedBytes<32>>, ProviderError>

Get the hash of the block with the given number. Returns None if no block with this number exists.
§

fn convert_block_hash( &self, hash_or_number: HashOrNumber, ) -> Result<Option<FixedBytes<32>>, ProviderError>

Get the hash of the block with the given number. Returns None if no block with this number exists.
§

fn canonical_hashes_range( &self, start: u64, end: u64, ) -> Result<Vec<FixedBytes<32>>, ProviderError>

Get headers in range of block hashes or numbers Read more
§

impl<T> BlockIdReader for Arc<T>
where T: BlockIdReader + ?Sized, Arc<T>: BlockNumReader + Send + Sync,

§

fn convert_block_number( &self, num: BlockNumberOrTag, ) -> Result<Option<u64>, ProviderError>

Converts the BlockNumberOrTag variants to a block number.
§

fn block_hash_for_id( &self, block_id: BlockId, ) -> Result<Option<FixedBytes<32>>, ProviderError>

Get the hash of the block by matching the given id.
§

fn block_number_for_id( &self, block_id: BlockId, ) -> Result<Option<u64>, ProviderError>

Get the number of the block by matching the given id.
§

fn pending_block_num_hash(&self) -> Result<Option<NumHash>, ProviderError>

Get the current pending block number and hash.
§

fn safe_block_num_hash(&self) -> Result<Option<NumHash>, ProviderError>

Get the current safe block number and hash.
§

fn finalized_block_num_hash(&self) -> Result<Option<NumHash>, ProviderError>

Get the current finalized block number and hash.
§

fn safe_block_number(&self) -> Result<Option<u64>, ProviderError>

Get the safe block number.
§

fn finalized_block_number(&self) -> Result<Option<u64>, ProviderError>

Get the finalized block number.
§

fn safe_block_hash(&self) -> Result<Option<FixedBytes<32>>, ProviderError>

Get the safe block hash.
§

fn finalized_block_hash(&self) -> Result<Option<FixedBytes<32>>, ProviderError>

Get the finalized block hash.
§

impl<T> BlockNumReader for Arc<T>
where T: BlockNumReader + ?Sized, Arc<T>: BlockHashReader + Send + Sync,

§

fn chain_info(&self) -> Result<ChainInfo, ProviderError>

Returns the current info for the chain.
§

fn best_block_number(&self) -> Result<u64, ProviderError>

Returns the best block number in the chain.
§

fn last_block_number(&self) -> Result<u64, ProviderError>

Returns the last block number associated with the last canonical header in the database.
§

fn block_number( &self, hash: FixedBytes<32>, ) -> Result<Option<u64>, ProviderError>

Gets the BlockNumber for the given hash. Returns None if no block with this hash exists.
§

fn convert_hash_or_number( &self, id: HashOrNumber, ) -> Result<Option<u64>, ProviderError>

Gets the block number for the given BlockHashOrNumber. Returns None if no block with this hash exists. If the BlockHashOrNumber is a Number, it is returned as is.
§

fn convert_number( &self, id: HashOrNumber, ) -> Result<Option<FixedBytes<32>>, ProviderError>

Gets the block hash for the given BlockHashOrNumber. Returns None if no block with this number exists. If the BlockHashOrNumber is a Hash, it is returned as is.
§

impl<T> BlockProvider for Arc<T>
where T: BlockProvider + ?Sized, Arc<T>: Send + Sync + 'static,

§

type Block = <T as BlockProvider>::Block

The block type.
§

fn subscribe_blocks( &self, tx: Sender<<Arc<T> as BlockProvider>::Block>, ) -> impl Future<Output = ()> + Send

Runs a block provider to send new blocks to the given sender. Read more
§

fn get_block( &self, block_number: u64, ) -> impl Future<Output = Result<<Arc<T> as BlockProvider>::Block, Report>> + Send

Get a past block by number.
§

fn get_or_fetch_previous_block( &self, previous_block_hashes: &AllocRingBuffer<FixedBytes<32>>, current_block_number: u64, offset: usize, ) -> impl Future<Output = Result<FixedBytes<32>, Report>> + Send

Get previous block hash using previous block hash buffer. If it isn’t available (buffer started more recently than offset), fetch it using get_block.
§

impl<T> BlockReader for Arc<T>
where T: BlockReader,

§

type Block = <T as BlockReader>::Block

The block type this provider reads.
§

fn find_block_by_hash( &self, hash: FixedBytes<32>, source: BlockSource, ) -> Result<Option<<Arc<T> as BlockReader>::Block>, ProviderError>

Tries to find in the given block source. Read more
§

fn block( &self, id: HashOrNumber, ) -> Result<Option<<Arc<T> as BlockReader>::Block>, ProviderError>

Returns the block with given id from the database. Read more
§

fn pending_block( &self, ) -> Result<Option<SealedBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns the pending block if available Read more
§

fn pending_block_with_senders( &self, ) -> Result<Option<RecoveredBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns the pending block if available Read more
§

fn pending_block_and_receipts( &self, ) -> Result<Option<(SealedBlock<<Arc<T> as BlockReader>::Block>, Vec<<Arc<T> as ReceiptProvider>::Receipt>)>, ProviderError>

Returns the pending block and receipts if available.
§

fn block_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<<Arc<T> as BlockReader>::Block>, ProviderError>

Returns the block with matching hash from the database. Read more
§

fn block_by_number( &self, num: u64, ) -> Result<Option<<Arc<T> as BlockReader>::Block>, ProviderError>

Returns the block with matching number from database. Read more
§

fn recovered_block( &self, id: HashOrNumber, transaction_kind: TransactionVariant, ) -> Result<Option<RecoveredBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns the block with senders with matching number or hash from database. Read more
§

fn sealed_block_with_senders( &self, id: HashOrNumber, transaction_kind: TransactionVariant, ) -> Result<Option<RecoveredBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns the sealed block with senders with matching number or hash from database. Read more
§

fn block_range( &self, range: RangeInclusive<u64>, ) -> Result<Vec<<Arc<T> as BlockReader>::Block>, ProviderError>

Returns all blocks in the given inclusive range. Read more
§

fn block_with_senders_range( &self, range: RangeInclusive<u64>, ) -> Result<Vec<RecoveredBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns a range of blocks from the database, along with the senders of each transaction in the blocks.
§

fn recovered_block_range( &self, range: RangeInclusive<u64>, ) -> Result<Vec<RecoveredBlock<<Arc<T> as BlockReader>::Block>>, ProviderError>

Returns a range of sealed blocks from the database, along with the senders of each transaction in the blocks.
§

impl<T> BlockWriter for Arc<T>
where T: BlockWriter + ?Sized, Arc<T>: Send + Sync,

§

type Block = <T as BlockWriter>::Block

The body this writer can write.
§

type Receipt = <T as BlockWriter>::Receipt

The receipt type for [ExecutionOutcome].
§

fn insert_block( &self, block: RecoveredBlock<<Arc<T> as BlockWriter>::Block>, write_to: StorageLocation, ) -> Result<StoredBlockBodyIndices, ProviderError>

Insert full block and make it canonical. Parent tx num and transition id is taken from parent block in database. Read more
§

fn append_block_bodies( &self, bodies: Vec<(u64, Option<<<Arc<T> as BlockWriter>::Block as Block>::Body>)>, write_to: StorageLocation, ) -> Result<(), ProviderError>

Appends a batch of block bodies extending the canonical chain. This is invoked during Bodies stage and does not write to TransactionHashNumbers and TransactionSenders tables which are populated on later stages. Read more
§

fn remove_blocks_above( &self, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

Removes all blocks above the given block number from the database. Read more
§

fn remove_bodies_above( &self, block: u64, remove_from: StorageLocation, ) -> Result<(), ProviderError>

Removes all block bodies above the given block number from the database.
§

fn append_blocks_with_state( &self, blocks: Vec<RecoveredBlock<<Arc<T> as BlockWriter>::Block>>, execution_outcome: &ExecutionOutcome<<Arc<T> as BlockWriter>::Receipt>, hashed_state: HashedPostStateSorted, trie_updates: TrieUpdates, ) -> Result<(), ProviderError>

Appends a batch of sealed blocks to the blockchain, including sender information, and updates the post-state. Read more
§

impl<T> BodiesClient for Arc<T>
where T: BodiesClient + ?Sized, Arc<T>: DownloadClient,

§

type Body = <T as BodiesClient>::Body

The body type this client fetches.
§

type Output = <T as BodiesClient>::Output

The output of the request future for querying block bodies.
§

fn get_block_bodies( &self, hashes: Vec<FixedBytes<32>>, ) -> <Arc<T> as BodiesClient>::Output

Fetches the block body for the requested block.
§

fn get_block_bodies_with_priority( &self, hashes: Vec<FixedBytes<32>>, priority: Priority, ) -> <Arc<T> as BodiesClient>::Output

Fetches the block body for the requested block with priority
§

fn get_block_body( &self, hash: FixedBytes<32>, ) -> SingleBodyRequest<<Arc<T> as BodiesClient>::Output>

Fetches a single block body for the requested hash.
§

fn get_block_body_with_priority( &self, hash: FixedBytes<32>, priority: Priority, ) -> SingleBodyRequest<<Arc<T> as BodiesClient>::Output>

Fetches a single block body for the requested hash with priority
1.0.0 · Source§

impl<T, A> Borrow<T> for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<M, P> BoundDataProvider<M> for Arc<P>
where M: DataMarker, P: BoundDataProvider<M> + ?Sized,

§

fn load_bound(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
§

fn bound_key(&self) -> DataKey

Returns the [DataKey] that this provider uses for loading data.
§

impl<T> BufferProvider for Arc<T>
where T: BufferProvider + ?Sized,

§

fn load_buffer( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<BufferMarker>, DataError>

Loads a [DataPayload]<[BufferMarker]> according to the key and request.
Source§

impl<T> BuiltPayload for Arc<T>
where T: BuiltPayload + ?Sized, Arc<T>: Send + Sync + Debug,

Source§

type Primitives = <T as BuiltPayload>::Primitives

The node’s primitive types
Source§

fn block( &self, ) -> &SealedBlock<<<Arc<T> as BuiltPayload>::Primitives as NodePrimitives>::Block>

Returns the built block (sealed)
Source§

fn fees(&self) -> Uint<256, 4>

Returns the fees collected for the built block
Source§

fn executed_block( &self, ) -> Option<ExecutedBlockWithTrieUpdates<<Arc<T> as BuiltPayload>::Primitives>>

Returns the entire execution data for the built block, if available.
Source§

fn requests(&self) -> Option<Requests>

Returns the EIP-7685 requests for the payload if any.
§

impl<T> CanonicalDeserialize for Arc<T>
where T: CanonicalDeserialize + ToOwned + Sync + Send,

§

fn deserialize_with_mode<R>( reader: R, compress: Compress, validate: Validate, ) -> Result<Arc<T>, SerializationError>
where R: Read,

The general deserialize method that takes in customization flags.
§

fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_compressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>
where R: Read,

§

fn deserialize_uncompressed_unchecked<R>( reader: R, ) -> Result<Self, SerializationError>
where R: Read,

§

impl<T> CanonicalSerialize for Arc<T>
where T: CanonicalSerialize + ToOwned,

§

fn serialize_with_mode<W>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
where W: Write,

The general serialize method that takes in customization flags.
§

fn serialized_size(&self, compress: Compress) -> usize

§

fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

§

fn compressed_size(&self) -> usize

§

fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>
where W: Write,

§

fn uncompressed_size(&self) -> usize

§

impl<T> Cfg for Arc<T>
where T: Cfg + ?Sized,

§

type Spec = <T as Cfg>::Spec

§

fn chain_id(&self) -> u64

§

fn spec(&self) -> <Arc<T> as Cfg>::Spec

§

fn blob_max_count(&self, spec_id: SpecId) -> u64

Returns the blob target and max count for the given spec id. Read more
§

fn max_code_size(&self) -> usize

§

fn is_eip3607_disabled(&self) -> bool

§

fn is_balance_check_disabled(&self) -> bool

§

fn is_block_gas_limit_disabled(&self) -> bool

§

fn is_nonce_check_disabled(&self) -> bool

§

fn is_base_fee_check_disabled(&self) -> bool

§

impl<T> ChainSpecProvider for Arc<T>
where T: ChainSpecProvider + ?Sized, Arc<T>: Debug + Send + Sync,

§

type ChainSpec = <T as ChainSpecProvider>::ChainSpec

The chain spec type.
§

fn chain_spec(&self) -> Arc<<Arc<T> as ChainSpecProvider>::ChainSpec>

Get an Arc to the chainspec.
§

impl<T> ChangeSetReader for Arc<T>
where T: ChangeSetReader + ?Sized,

§

fn account_block_changeset( &self, block_number: u64, ) -> Result<Vec<AccountBeforeTx>, ProviderError>

Iterate over account changesets and return the account state from before this block.
1.0.0 · Source§

impl<T, A> Clone for Arc<T, A>
where A: Allocator + Clone, T: ?Sized,

Source§

fn clone(&self) -> Arc<T, A>

Makes a clone of the Arc pointer.

This creates another pointer to the same allocation, increasing the strong reference count.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

let _ = Arc::clone(&five);
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
§

impl<T> ConfigureEvm for Arc<T>
where T: ConfigureEvm + ?Sized, Arc<T>: Clone + Debug + Send + Sync + Unpin,

§

type Primitives = <T as ConfigureEvm>::Primitives

The primitives type used by the EVM.
§

type Error = <T as ConfigureEvm>::Error

The error type that is returned by [Self::next_evm_env].
§

type NextBlockEnvCtx = <T as ConfigureEvm>::NextBlockEnvCtx

Context required for configuring next block environment. Read more
§

type BlockExecutorFactory = <T as ConfigureEvm>::BlockExecutorFactory

Configured [BlockExecutorFactory], contains [EvmFactory] internally.
§

type BlockAssembler = <T as ConfigureEvm>::BlockAssembler

A type that knows how to build a block.
§

fn block_executor_factory( &self, ) -> &<Arc<T> as ConfigureEvm>::BlockExecutorFactory

Returns reference to the configured [BlockExecutorFactory].
§

fn block_assembler(&self) -> &<Arc<T> as ConfigureEvm>::BlockAssembler

Returns reference to the configured [BlockAssembler].
§

fn evm_env( &self, header: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, ) -> EvmEnv<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec>

Creates a new [EvmEnv] for the given header.
§

fn next_evm_env( &self, parent: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, attributes: &<Arc<T> as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<EvmEnv<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec>, <Arc<T> as ConfigureEvm>::Error>

Returns the configured [EvmEnv] for parent + 1 block. Read more
§

fn context_for_block<'a>( &self, block: &'a SealedBlock<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Block>, ) -> <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>

Returns the configured [BlockExecutorFactory::ExecutionCtx] for a given block.
§

fn context_for_next_block( &self, parent: &SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, attributes: <Arc<T> as ConfigureEvm>::NextBlockEnvCtx, ) -> <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'_>

Returns the configured [BlockExecutorFactory::ExecutionCtx] for parent + 1 block.
§

fn tx_env( &self, transaction: impl IntoTxEnv<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Tx>, ) -> <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Tx

Returns a [TxEnv] from a transaction and [Address].
§

fn evm_factory( &self, ) -> &<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory

Provides a reference to [EvmFactory] implementation.
§

fn evm_with_env<DB>( &self, db: DB, evm_env: EvmEnv<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec>, ) -> <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<DB, NoOpInspector>
where DB: Database,

Returns a new EVM with the given database configured with the given environment settings, including the spec id and transaction environment. Read more
§

fn evm_for_block<DB>( &self, db: DB, header: &<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader, ) -> <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<DB, NoOpInspector>
where DB: Database,

Returns a new EVM with the given database configured with cfg and block_env configuration derived from the given header. Relies on [ConfigureEvm::evm_env]. Read more
§

fn evm_with_env_and_inspector<DB, I>( &self, db: DB, evm_env: EvmEnv<<<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Spec>, inspector: I, ) -> <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<DB, I>
where DB: Database, I: InspectorFor<Arc<T>, DB>,

Returns a new EVM with the given database configured with the given environment settings, including the spec id. Read more
§

fn create_executor<'a, DB, I>( &'a self, evm: <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>, ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, ) -> impl BlockExecutorFor<'a, <Arc<T> as ConfigureEvm>::BlockExecutorFactory, DB, I>
where DB: Database, I: InspectorFor<Arc<T>, &'a mut State<DB>> + 'a,

Creates a strategy with given EVM and execution context.
§

fn executor_for_block<'a, DB>( &'a self, db: &'a mut State<DB>, block: &'a SealedBlock<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::Block>, ) -> impl BlockExecutorFor<'a, <Arc<T> as ConfigureEvm>::BlockExecutorFactory, DB>
where DB: Database,

Creates a strategy for execution of a given block.
§

fn create_block_builder<'a, DB, I>( &'a self, evm: <<<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::EvmFactory as EvmFactory>::Evm<&'a mut State<DB>, I>, parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, ctx: <<Arc<T> as ConfigureEvm>::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>, ) -> impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives> + BlockExecutorFor<'a, <Arc<T> as ConfigureEvm>::BlockExecutorFactory, DB, I>
where DB: Database, I: InspectorFor<Arc<T>, &'a mut State<DB>> + 'a,

Creates a [BlockBuilder]. Should be used when building a new block. Read more
§

fn builder_for_next_block<'a, DB>( &'a self, db: &'a mut State<DB>, parent: &'a SealedHeader<<<Arc<T> as ConfigureEvm>::Primitives as NodePrimitives>::BlockHeader>, attributes: <Arc<T> as ConfigureEvm>::NextBlockEnvCtx, ) -> Result<impl BlockBuilder<Primitives = <Arc<T> as ConfigureEvm>::Primitives>, <Arc<T> as ConfigureEvm>::Error>
where DB: Database,

Creates a [BlockBuilder] for building of a new block. This is a helper to invoke [ConfigureEvm::create_block_builder].
§

impl<B, T> Consensus<B> for Arc<T>
where B: Block, T: Consensus<B> + ?Sized, Arc<T>: HeaderValidator<<B as Block>::Header>,

§

type Error = <T as Consensus<B>>::Error

The error type related to consensus.
§

fn validate_body_against_header( &self, body: &<B as Block>::Body, header: &SealedHeader<<B as Block>::Header>, ) -> Result<(), <Arc<T> as Consensus<B>>::Error>

Ensures that body field values match the header.
§

fn validate_block_pre_execution( &self, block: &SealedBlock<B>, ) -> Result<(), <Arc<T> as Consensus<B>>::Error>

Validate a block disregarding world state, i.e. things that can be checked before sender recovery and execution. Read more
§

impl<T> CounterFn for Arc<T>
where T: CounterFn,

§

fn increment(&self, value: u64)

Increments the counter by the given amount.
§

fn absolute(&self, value: u64)

Sets the counter to at least the given amount. Read more
§

impl<M, P> DataProvider<M> for Arc<P>
where M: KeyedDataMarker, P: DataProvider<M> + ?Sized,

§

fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
§

impl<DB> Database for Arc<DB>
where DB: Database,

§

type TX = <DB as Database>::TX

Read-Only database transaction
§

type TXMut = <DB as Database>::TXMut

Read-Write database transaction
§

fn tx(&self) -> Result<<Arc<DB> as Database>::TX, DatabaseError>

Create read only transaction.
§

fn tx_mut(&self) -> Result<<Arc<DB> as Database>::TXMut, DatabaseError>

Create read write transaction only possible if database is open with write access.
§

fn view<T, F>(&self, f: F) -> Result<T, DatabaseError>
where F: FnOnce(&Self::TX) -> T,

Takes a function and passes a read-only transaction into it, making sure it’s closed in the end of the execution.
§

fn update<T, F>(&self, f: F) -> Result<T, DatabaseError>
where F: FnOnce(&Self::TXMut) -> T,

Takes a function and passes a write-read transaction into it, making sure it’s committed in the end of the execution.
§

impl<DB> DatabaseMetrics for Arc<DB>
where DB: DatabaseMetrics,

§

fn report_metrics(&self)

Reports metrics for the database.
§

fn gauge_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Returns a list of Gauge metrics for the database.
§

fn counter_metrics(&self) -> Vec<(&'static str, u64, Vec<Label>)>

Returns a list of Counter metrics for the database.
§

fn histogram_metrics(&self) -> Vec<(&'static str, f64, Vec<Label>)>

Returns a list of Histogram metrics for the database.
§

impl<T> DatabaseProviderFactory for Arc<T>
where T: DatabaseProviderFactory + ?Sized, Arc<T>: Send + Sync,

§

type DB = <T as DatabaseProviderFactory>::DB

Database this factory produces providers for.
§

type Provider = <T as DatabaseProviderFactory>::Provider

Provider type returned by the factory.
§

type ProviderRW = <T as DatabaseProviderFactory>::ProviderRW

Read-write provider type returned by the factory.
§

fn database_provider_ro( &self, ) -> Result<<Arc<T> as DatabaseProviderFactory>::Provider, ProviderError>

Create new read-only database provider.
§

fn database_provider_rw( &self, ) -> Result<<Arc<T> as DatabaseProviderFactory>::ProviderRW, ProviderError>

Create new read-write database provider.
§

impl<T> DatabaseRef for Arc<T>
where T: DatabaseRef + ?Sized,

§

type Error = <T as DatabaseRef>::Error

The database error type.
§

fn basic_ref( &self, address: Address, ) -> Result<Option<AccountInfo>, <Arc<T> as DatabaseRef>::Error>

Gets basic account information.
§

fn code_by_hash_ref( &self, code_hash: FixedBytes<32>, ) -> Result<Bytecode, <Arc<T> as DatabaseRef>::Error>

Gets account code by its hash.
§

fn storage_ref( &self, address: Address, index: Uint<256, 4>, ) -> Result<Uint<256, 4>, <Arc<T> as DatabaseRef>::Error>

Gets storage value of address at index.
§

fn block_hash_ref( &self, number: u64, ) -> Result<FixedBytes<32>, <Arc<T> as DatabaseRef>::Error>

Gets block hash by block number.
1.0.0 · Source§

impl<T, A> Debug for Arc<T, A>
where T: Debug + ?Sized, A: Allocator,

Source§

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

Formats the value using the given formatter. Read more
§

impl<T> Decodable for Arc<T>
where T: Decodable,

§

fn decode(buf: &mut &[u8]) -> Result<Arc<T>, Error>

Decodes the blob into the appropriate type. buf must be advanced past the decoded object.
§

impl<T> Decode for Arc<T>
where T: Decode,

§

fn is_ssz_fixed_len() -> bool

Returns true if this object has a fixed-length. Read more
§

fn ssz_fixed_len() -> usize

The number of bytes this object occupies in the fixed-length portion of the SSZ bytes. Read more
§

fn from_ssz_bytes(bytes: &[u8]) -> Result<Arc<T>, DecodeError>

Attempts to decode Self from bytes, returning a DecodeError on failure. Read more
1.0.0 · Source§

impl<T> Default for Arc<T>
where T: Default,

Source§

fn default() -> Arc<T>

Creates a new Arc<T>, with the Default value for T.

§Examples
use std::sync::Arc;

let x: Arc<i32> = Default::default();
assert_eq!(*x, 0);
1.0.0 · Source§

impl<T, A> Deref for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for Arc<T>
where Box<T>: Deserialize<'de>, T: ?Sized,

This impl requires the "rc" Cargo feature of Serde.

Deserializing a data structure containing Arc will not attempt to deduplicate Arc references to the same data. Every deserialized Arc will end up with a strong count of 1.

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Arc<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl<'de, T, U> DeserializeAs<'de, Arc<T>> for Arc<U>
where U: DeserializeAs<'de, T>,

Source§

fn deserialize_as<D>( deserializer: D, ) -> Result<Arc<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
1.0.0 · Source§

impl<T, A> Display for Arc<T, A>
where T: Display + ?Sized, A: Allocator,

Source§

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

Formats the value using the given formatter. Read more
§

impl<T> DownloadClient for Arc<T>
where T: DownloadClient + ?Sized, Arc<T>: Send + Sync + Debug,

§

fn report_bad_message(&self, peer_id: FixedBytes<64>)

Penalize the peer for responding with a message that violates validation rules
§

fn num_connected_peers(&self) -> usize

Returns how many peers the network is currently connected to.
1.0.0 · Source§

impl<T, A> Drop for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn drop(&mut self)

Drops the Arc.

This will decrement the strong reference count. If the strong reference count reaches zero then the only other references (if any) are Weak, so we drop the inner value.

§Examples
use std::sync::Arc;

struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {
        println!("dropped!");
    }
}

let foo  = Arc::new(Foo);
let foo2 = Arc::clone(&foo);

drop(foo);    // Doesn't print anything
drop(foo2);   // Prints "dropped!"
§

impl<M, P> DynamicDataProvider<M> for Arc<P>
where M: DataMarker, P: DynamicDataProvider<M> + ?Sized,

§

fn load_data( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
§

impl<T> Encodable for Arc<T>
where T: Encodable + ?Sized,

§

fn length(&self) -> usize

Returns the length of the encoding of this type in bytes. Read more
§

fn encode(&self, out: &mut dyn BufMut)

Encodes the type into the out buffer.
§

impl<T> Encode for Arc<T>
where T: Encode,

§

fn is_ssz_fixed_len() -> bool

Returns true if this object has a fixed-length. Read more
§

fn ssz_fixed_len() -> usize

The number of bytes this object occupies in the fixed-length portion of the SSZ bytes. Read more
§

fn ssz_append(&self, buf: &mut Vec<u8>)

Append the encoding self to buf. Read more
§

fn ssz_bytes_len(&self) -> usize

Returns the size (in bytes) when self is serialized. Read more
§

fn as_ssz_bytes(&self) -> Vec<u8>

Returns the full-form encoding of this object. Read more
1.52.0 · Source§

impl<T> Error for Arc<T>
where T: Error + ?Sized,

Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
Source§

fn provide<'a>(&'a self, req: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access #99301)
Provides type-based access to context intended for error reports. Read more
§

impl<T> EthApiSpec for Arc<T>
where T: EthApiSpec + ?Sized, Arc<T>: RpcNodeCore, <Arc<T> as RpcNodeCore>::Provider: ChainSpecProvider + BlockNumReader + StageCheckpointReader, <<Arc<T> as RpcNodeCore>::Provider as ChainSpecProvider>::ChainSpec: EthereumHardforks, <Arc<T> as RpcNodeCore>::Network: NetworkInfo,

§

type Transaction = <T as EthApiSpec>::Transaction

The transaction type signers are using.
§

fn starting_block(&self) -> Uint<256, 4>

Returns the block node is started on.
§

fn signers( &self, ) -> &RwLock<RawRwLock, Vec<Box<dyn EthSigner<<Arc<T> as EthApiSpec>::Transaction>>>>

Returns a handle to the signers owned by provider.
§

fn protocol_version( &self, ) -> impl Future<Output = Result<Uint<64, 1>, RethError>> + Send

Returns the current ethereum protocol version.
§

fn chain_id(&self) -> Uint<64, 1>

Returns the chain id
§

fn chain_info(&self) -> Result<ChainInfo, RethError>

Returns provider chain info
§

fn accounts(&self) -> Vec<Address>

Returns a list of addresses owned by provider.
§

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.
§

fn sync_status(&self) -> Result<SyncStatus, RethError>

Returns the [SyncStatus] of the network
§

impl<T> EthChainSpec for Arc<T>
where T: EthChainSpec + ?Sized, Arc<T>: Send + Sync + Unpin + Debug,

§

type Header = <T as EthChainSpec>::Header

The header type of the network.
§

fn chain(&self) -> Chain

Returns the [Chain] object this spec targets.
§

fn chain_id(&self) -> u64

Returns the chain id number
§

fn base_fee_params_at_block(&self, block_number: u64) -> BaseFeeParams

Get the [BaseFeeParams] for the chain at the given block.
§

fn base_fee_params_at_timestamp(&self, timestamp: u64) -> BaseFeeParams

Get the [BaseFeeParams] for the chain at the given timestamp.
§

fn blob_params_at_timestamp(&self, timestamp: u64) -> Option<BlobParams>

Get the [BlobParams] for the given timestamp
§

fn deposit_contract(&self) -> Option<&DepositContract>

Returns the deposit contract data for the chain, if it’s present
§

fn genesis_hash(&self) -> FixedBytes<32>

The genesis hash.
§

fn prune_delete_limit(&self) -> usize

The delete limit for pruner, per run.
§

fn display_hardforks(&self) -> Box<dyn Display>

Returns a string representation of the hardforks.
§

fn genesis_header(&self) -> &<Arc<T> as EthChainSpec>::Header

The genesis header.
§

fn genesis(&self) -> &Genesis

The genesis block specification.
§

fn bootnodes(&self) -> Option<Vec<NodeRecord>>

The bootnodes for the chain, if any.
§

fn is_optimism(&self) -> bool

Returns true if this chain contains Optimism configuration.
§

fn is_ethereum(&self) -> bool

Returns true if this chain contains Ethereum configuration.
§

fn final_paris_total_difficulty(&self) -> Option<Uint<256, 4>>

Returns the final total difficulty if the Paris hardfork is known.
§

impl<T> EthExecutorSpec for Arc<T>
where T: EthExecutorSpec + ?Sized, Arc<T>: EthereumHardforks,

§

fn deposit_contract_address(&self) -> Option<Address>

Address of deposit contract emitting deposit events. Read more
§

impl<T> EthereumHardforks for Arc<T>
where T: EthereumHardforks + ?Sized,

§

fn ethereum_fork_activation(&self, fork: EthereumHardfork) -> ForkCondition

Retrieves [ForkCondition] by an [EthereumHardfork]. If fork is not present, returns [ForkCondition::Never].
§

fn is_ethereum_fork_active_at_timestamp( &self, fork: EthereumHardfork, timestamp: u64, ) -> bool

Convenience method to check if an [EthereumHardfork] is active at a given timestamp.
§

fn is_ethereum_fork_active_at_block( &self, fork: EthereumHardfork, block_number: u64, ) -> bool

Convenience method to check if an [EthereumHardfork] is active at a given block number.
§

fn is_shanghai_active_at_timestamp(&self, timestamp: u64) -> bool

Convenience method to check if [EthereumHardfork::Shanghai] is active at a given timestamp.
§

fn is_cancun_active_at_timestamp(&self, timestamp: u64) -> bool

Convenience method to check if [EthereumHardfork::Cancun] is active at a given timestamp.
§

fn is_prague_active_at_timestamp(&self, timestamp: u64) -> bool

Convenience method to check if [EthereumHardfork::Prague] is active at a given timestamp.
§

fn is_osaka_active_at_timestamp(&self, timestamp: u64) -> bool

Convenience method to check if [EthereumHardfork::Osaka] is active at a given timestamp.
§

fn is_byzantium_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::Byzantium] is active at a given block number.
§

fn is_spurious_dragon_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::SpuriousDragon] is active at a given block number.
§

fn is_homestead_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::Homestead] is active at a given block number.
§

fn is_london_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::London] is active at a given block number.
§

fn is_constantinople_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::Constantinople] is active at a given block number.
§

fn is_paris_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [EthereumHardfork::Paris] is active at a given block number.
1.21.0 · Source§

impl<T, A> From<Box<T, A>> for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

fn from(v: Box<T, A>) -> Arc<T, A>

Move a boxed object to a new, reference-counted allocation.

§Example
let unique: Box<str> = Box::from("eggplant");
let shared: Arc<str> = Arc::from(unique);
assert_eq!("eggplant", &shared[..]);
1.45.0 · Source§

impl<'a, B> From<Cow<'a, B>> for Arc<B>
where B: ToOwned + ?Sized, Arc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

Source§

fn from(cow: Cow<'a, B>) -> Arc<B>

Creates an atomically reference-counted pointer from a clone-on-write pointer by copying its content.

§Example
let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
let shared: Arc<str> = Arc::from(cow);
assert_eq!("eggplant", &shared[..]);
1.6.0 · Source§

impl<T> From<T> for Arc<T>

Source§

fn from(t: T) -> Arc<T>

Converts a T into an Arc<T>

The conversion moves the value into a newly allocated Arc. It is equivalent to calling Arc::new(t).

§Example
let x = 5;
let arc = Arc::new(5);

assert_eq!(Arc::from(x), arc);
§

impl<T> FromHex for Arc<T>
where T: FromHex,

§

type Error = <T as FromHex>::Error

The associated error which can be returned from parsing.
§

fn from_hex<U>(hex: U) -> Result<Arc<T>, <Arc<T> as FromHex>::Error>
where U: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails with a custom error type. Read more
§

impl<N, T> FullConsensus<N> for Arc<T>
where N: NodePrimitives, T: FullConsensus<N> + ?Sized, Arc<T>: Consensus<<N as NodePrimitives>::Block>,

§

fn validate_block_post_execution( &self, block: &RecoveredBlock<<N as NodePrimitives>::Block>, result: &BlockExecutionResult<<N as NodePrimitives>::Receipt>, ) -> Result<(), ConsensusError>

Validate a block considering world state, i.e. things that can not be checked before execution. Read more
§

impl<T> GaugeFn for Arc<T>
where T: GaugeFn,

§

fn increment(&self, value: f64)

Increments the gauge by the given amount.
§

fn decrement(&self, value: f64)

Decrements the gauge by the given amount.
§

fn set(&self, value: f64)

Sets the gauge to the given amount.
§

impl<T> Hardforks for Arc<T>
where T: Hardforks + ?Sized, Arc<T>: Clone,

§

fn fork<H>(&self, fork: H) -> ForkCondition
where H: Hardfork,

Retrieves [ForkCondition] from fork. If fork is not present, returns [ForkCondition::Never].
§

fn forks_iter( &self, ) -> impl Iterator<Item = (&(dyn Hardfork + 'static), ForkCondition)>

Get an iterator of all hardforks with their respective activation conditions.
§

fn is_fork_active_at_timestamp<H>(&self, fork: H, timestamp: u64) -> bool
where H: Hardfork,

Convenience method to check if a fork is active at a given timestamp.
§

fn is_fork_active_at_block<H>(&self, fork: H, block_number: u64) -> bool
where H: Hardfork,

Convenience method to check if a fork is active at a given block number.
§

fn fork_id(&self, head: &Head) -> ForkId

Compute the [ForkId] for the given [Head] following eip-6122 spec
§

fn latest_fork_id(&self) -> ForkId

Returns the [ForkId] for the last fork. Read more
§

fn fork_filter(&self, head: Head) -> ForkFilter

Creates a [ForkFilter] for the block described by [Head].
1.0.0 · Source§

impl<T, A> Hash for Arc<T, A>
where T: Hash + ?Sized, A: Allocator,

Source§

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> HashedPostStateProvider for Arc<T>
where T: HashedPostStateProvider + ?Sized, Arc<T>: Send + Sync,

§

fn hashed_post_state(&self, bundle_state: &BundleState) -> HashedPostState

Returns the HashedPostState of the provided [BundleState].
§

impl<T> HashingWriter for Arc<T>
where T: HashingWriter + ?Sized, Arc<T>: Send + Sync,

§

fn unwind_account_hashing<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Unwind and clear account hashing. Read more
§

fn unwind_account_hashing_range( &self, range: impl RangeBounds<u64>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Unwind and clear account hashing in a given block range. Read more
§

fn insert_account_for_hashing( &self, accounts: impl IntoIterator<Item = (Address, Option<Account>)>, ) -> Result<BTreeMap<FixedBytes<32>, Option<Account>>, ProviderError>

Inserts all accounts into [AccountsHistory][reth_db_api::tables::AccountsHistory] table. Read more
§

fn unwind_storage_hashing( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Unwind and clear storage hashing. Read more
§

fn unwind_storage_hashing_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Unwind and clear storage hashing in a given block range. Read more
§

fn insert_storage_for_hashing( &self, storages: impl IntoIterator<Item = (Address, impl IntoIterator<Item = StorageEntry>)>, ) -> Result<HashMap<FixedBytes<32>, BTreeSet<FixedBytes<32>>, RandomState>, ProviderError>

Iterates over storages and inserts them to hashing table. Read more
§

fn insert_hashes( &self, range: RangeInclusive<u64>, end_block_hash: FixedBytes<32>, expected_state_root: FixedBytes<32>, ) -> Result<(), ProviderError>

Calculate the hashes of all changed accounts and storages, and finally calculate the state root. Read more
§

impl<T> HeaderProvider for Arc<T>
where T: HeaderProvider + ?Sized, Arc<T>: Send + Sync,

§

type Header = <T as HeaderProvider>::Header

The header type this provider supports.
§

fn is_known(&self, block_hash: &FixedBytes<32>) -> Result<bool, ProviderError>

Check if block is known
§

fn header( &self, block_hash: &FixedBytes<32>, ) -> Result<Option<<Arc<T> as HeaderProvider>::Header>, ProviderError>

Get header by block hash
§

fn sealed_header_by_hash( &self, block_hash: FixedBytes<32>, ) -> Result<Option<SealedHeader<<Arc<T> as HeaderProvider>::Header>>, ProviderError>

Retrieves the header sealed by the given block hash.
§

fn header_by_number( &self, num: u64, ) -> Result<Option<<Arc<T> as HeaderProvider>::Header>, ProviderError>

Get header by block number
§

fn header_by_hash_or_number( &self, hash_or_num: HashOrNumber, ) -> Result<Option<<Arc<T> as HeaderProvider>::Header>, ProviderError>

Get header by block number or hash
§

fn header_td( &self, hash: &FixedBytes<32>, ) -> Result<Option<Uint<256, 4>>, ProviderError>

Get total difficulty by block hash.
§

fn header_td_by_number( &self, number: u64, ) -> Result<Option<Uint<256, 4>>, ProviderError>

Get total difficulty by block number.
§

fn headers_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<<Arc<T> as HeaderProvider>::Header>, ProviderError>

Get headers in range of block numbers
§

fn sealed_header( &self, number: u64, ) -> Result<Option<SealedHeader<<Arc<T> as HeaderProvider>::Header>>, ProviderError>

Get a single sealed header by block number.
§

fn sealed_headers_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<SealedHeader<<Arc<T> as HeaderProvider>::Header>>, ProviderError>

Get headers in range of block numbers.
§

fn sealed_headers_while( &self, range: impl RangeBounds<u64>, predicate: impl FnMut(&SealedHeader<<Arc<T> as HeaderProvider>::Header>) -> bool, ) -> Result<Vec<SealedHeader<<Arc<T> as HeaderProvider>::Header>>, ProviderError>

Get sealed headers while predicate returns true or the range is exhausted.
§

impl<T> HeaderSyncGapProvider for Arc<T>
where T: HeaderSyncGapProvider + ?Sized, Arc<T>: Send + Sync,

§

type Header = <T as HeaderSyncGapProvider>::Header

The header type.
§

fn local_tip_header( &self, highest_uninterrupted_block: u64, ) -> Result<SealedHeader<<Arc<T> as HeaderSyncGapProvider>::Header>, ProviderError>

Find a current sync gap for the headers depending on the last uninterrupted block number. Last uninterrupted block represents the block number before which there are no gaps. It’s up to the caller to ensure that last uninterrupted block is determined correctly.
§

impl<H, T> HeaderValidator<H> for Arc<T>
where T: HeaderValidator<H> + ?Sized, Arc<T>: Debug + Send + Sync,

§

fn validate_header( &self, header: &SealedHeader<H>, ) -> Result<(), ConsensusError>

Validate if header is correct and follows consensus specification. Read more
§

fn validate_header_against_parent( &self, header: &SealedHeader<H>, parent: &SealedHeader<H>, ) -> Result<(), ConsensusError>

Validate that the header information regarding parent are correct. This checks the block number, timestamp, basefee and gas limit increment. Read more
§

fn validate_header_range( &self, headers: &[SealedHeader<H>], ) -> Result<(), HeaderConsensusError<H>>
where H: Clone,

Validates the given headers Read more
§

fn validate_header_with_total_difficulty( &self, header: &H, total_difficulty: Uint<256, 4>, ) -> Result<(), ConsensusError>

Validate if the header is correct and follows the consensus specification, including computed properties (like total difficulty). Read more
§

impl<T> HeadersClient for Arc<T>
where T: HeadersClient + ?Sized, Arc<T>: DownloadClient,

§

type Header = <T as HeadersClient>::Header

The header type this client fetches.
§

type Output = <T as HeadersClient>::Output

The headers future type
§

fn get_headers( &self, request: HeadersRequest, ) -> <Arc<T> as HeadersClient>::Output

Sends the header request to the p2p network and returns the header response received from a peer.
§

fn get_headers_with_priority( &self, request: HeadersRequest, priority: Priority, ) -> <Arc<T> as HeadersClient>::Output

Sends the header request to the p2p network with priority set and returns the header response received from a peer.
§

fn get_header( &self, start: HashOrNumber, ) -> SingleHeaderRequest<<Arc<T> as HeadersClient>::Output>

Fetches a single header for the requested number or hash.
§

fn get_header_with_priority( &self, start: HashOrNumber, priority: Priority, ) -> SingleHeaderRequest<<Arc<T> as HeadersClient>::Output>

Fetches a single header for the requested number or hash with priority
§

impl<T> HistogramFn for Arc<T>
where T: HistogramFn,

§

fn record(&self, value: f64)

Records a value into the histogram.
§

fn record_many(&self, value: f64, count: usize)

Records a value into the histogram multiple times.
§

impl<T> HistoryWriter for Arc<T>
where T: HistoryWriter + ?Sized, Arc<T>: Send + Sync,

§

fn unwind_account_history_indices<'a>( &self, changesets: impl Iterator<Item = &'a (u64, AccountBeforeTx)>, ) -> Result<usize, ProviderError>

Unwind and clear account history indices. Read more
§

fn unwind_account_history_indices_range( &self, range: impl RangeBounds<u64>, ) -> Result<usize, ProviderError>

Unwind and clear account history indices in a given block range. Read more
§

fn insert_account_history_index( &self, index_updates: impl IntoIterator<Item = (Address, impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

Insert account change index to database. Used inside AccountHistoryIndex stage
§

fn unwind_storage_history_indices( &self, changesets: impl Iterator<Item = (BlockNumberAddress, StorageEntry)>, ) -> Result<usize, ProviderError>

Unwind and clear storage history indices. Read more
§

fn unwind_storage_history_indices_range( &self, range: impl RangeBounds<BlockNumberAddress>, ) -> Result<usize, ProviderError>

Unwind and clear storage history indices in a given block range. Read more
§

fn insert_storage_history_index( &self, storage_transitions: impl IntoIterator<Item = ((Address, FixedBytes<32>), impl IntoIterator<Item = u64>)>, ) -> Result<(), ProviderError>

Insert storage change index to database. Used inside StorageHistoryIndex stage
§

fn update_history_indices( &self, range: RangeInclusive<u64>, ) -> Result<(), ProviderError>

Read account/storage changesets and update account/storage history indices.
§

impl<T> InMemorySize for Arc<T>
where T: InMemorySize + ?Sized,

§

fn size(&self) -> usize

Returns a heuristic for the in-memory size of a struct.
§

impl<T> InstructionProvider for Arc<T>
where T: InstructionProvider + ?Sized,

§

type Context = <T as InstructionProvider>::Context

Context type.
§

type InterpreterTypes = <T as InstructionProvider>::InterpreterTypes

Interpreter types.
§

fn instruction_table( &self, ) -> &[for<'a> fn(&'a mut Interpreter<<Arc<T> as InstructionProvider>::InterpreterTypes>, &'a mut <Arc<T> as InstructionProvider>::Context); 256]

Returns the instruction table that is used by EvmTr to execute instructions.
§

impl<Sp> LocalSpawn for Arc<Sp>
where Sp: LocalSpawn + ?Sized,

§

fn spawn_local_obj( &self, future: LocalFutureObj<'static, ()>, ) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
§

impl<'a, W> MakeWriter<'a> for Arc<W>
where &'a W: Write + 'a,

§

type Writer = &'a W

The concrete io::Write implementation returned by make_writer.
§

fn make_writer(&'a self) -> <Arc<W> as MakeWriter<'a>>::Writer

Returns an instance of Writer. Read more
§

fn make_writer_for(&'a self, meta: &Metadata<'_>) -> Self::Writer

Returns a Writer for writing data from the span or event described by the provided Metadata. Read more
§

impl<T> NetworkEventListenerProvider for Arc<T>
where T: NetworkEventListenerProvider + ?Sized, Arc<T>: NetworkPeersEvents,

§

type Primitives = <T as NetworkEventListenerProvider>::Primitives

The primitive types to use in the PeerRequest used in the stream.
§

fn event_listener( &self, ) -> EventStream<NetworkEvent<PeerRequest<<Arc<T> as NetworkEventListenerProvider>::Primitives>>>

Creates a new [NetworkEvent] listener channel.
§

fn discovery_listener(&self) -> UnboundedReceiverStream<DiscoveryEvent>

Returns a new [DiscoveryEvent] stream. Read more
§

impl<T> NetworkInfo for Arc<T>
where T: NetworkInfo + ?Sized, Arc<T>: Send + Sync,

§

fn local_addr(&self) -> SocketAddr

Returns the SocketAddr that listens for incoming connections.
§

fn network_status( &self, ) -> impl Future<Output = Result<NetworkStatus, NetworkError>> + Send

Returns the current status of the network being ran by the local node.
§

fn chain_id(&self) -> u64

Returns the chain id
§

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.
§

fn is_initially_syncing(&self) -> bool

Returns true when the node is undergoing the very first Pipeline sync.
§

impl<T> NetworkPeersEvents for Arc<T>
where T: NetworkPeersEvents + ?Sized, Arc<T>: Send + Sync,

§

fn peer_events(&self) -> PeerEventStream

Creates a new peer event listener stream.
§

impl<T> NetworkSyncUpdater for Arc<T>
where T: NetworkSyncUpdater + ?Sized, Arc<T>: Debug + Send + Sync + 'static,

§

fn update_sync_state(&self, state: SyncState)

Notifies about a [SyncState] update.
§

fn update_status(&self, head: Head)

Updates the status of the p2p node
§

impl<N, T> NetworkWallet<N> for Arc<T>
where N: Network, T: NetworkWallet<N> + ?Sized, Arc<T>: Debug + Send + Sync,

§

fn default_signer_address(&self) -> Address

Get the default signer address. This address should be used in [NetworkWallet::sign_transaction_from] when no specific signer is specified.
§

fn has_signer_for(&self, address: &Address) -> bool

Return true if the signer contains a credential for the given address.
§

fn signer_addresses(&self) -> impl Iterator<Item = Address>

Return an iterator of all signer addresses.
§

fn sign_transaction_from( &self, sender: Address, tx: <N as Network>::UnsignedTx, ) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>

Asynchronously sign an unsigned transaction, with a specified credential.
§

fn sign_transaction( &self, tx: <N as Network>::UnsignedTx, ) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>

Asynchronously sign an unsigned transaction.
§

fn sign_request( &self, request: <N as Network>::TransactionRequest, ) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>

Asynchronously sign a transaction request, using the sender specified in the from field.
§

impl<T> NodePrimitivesProvider for Arc<T>
where T: NodePrimitivesProvider + ?Sized,

§

type Primitives = <T as NodePrimitivesProvider>::Primitives

The node primitive types.
§

impl<T> OmmersProvider for Arc<T>
where T: OmmersProvider,

§

fn ommers( &self, id: HashOrNumber, ) -> Result<Option<Vec<<Arc<T> as HeaderProvider>::Header>>, ProviderError>

Returns the ommers/uncle headers of the given block from the database. Read more
§

impl<T> OpHardforks for Arc<T>
where T: OpHardforks + ?Sized, Arc<T>: EthereumHardforks,

§

fn op_fork_activation(&self, fork: OpHardfork) -> ForkCondition

Retrieves [ForkCondition] by an [OpHardfork]. If fork is not present, returns [ForkCondition::Never].
§

fn is_bedrock_active_at_block(&self, block_number: u64) -> bool

Convenience method to check if [OpHardfork::Bedrock] is active at a given block number.
§

fn is_regolith_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Regolith is active at given block timestamp.
§

fn is_canyon_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Canyon is active at given block timestamp.
§

fn is_ecotone_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Ecotone is active at given block timestamp.
§

fn is_fjord_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Fjord is active at given block timestamp.
§

fn is_granite_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Granite is active at given block timestamp.
§

fn is_holocene_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Holocene is active at given block timestamp.
§

fn is_isthmus_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Isthmus is active at given block timestamp.
§

fn is_interop_active_at_timestamp(&self, timestamp: u64) -> bool

Returns true if Interop is active at given block timestamp.
§

impl<T> OpTxTr for Arc<T>
where T: OpTxTr + ?Sized, Arc<T>: Transaction,

§

fn enveloped_tx(&self) -> Option<&Bytes>

§

fn source_hash(&self) -> Option<FixedBytes<32>>

Source hash of the deposit transaction
§

fn mint(&self) -> Option<u128>

Mint of the deposit transaction
§

fn is_system_transaction(&self) -> bool

Whether the transaction is a system transaction
§

fn is_deposit(&self) -> bool

Returns true if transaction is of type [DEPOSIT_TRANSACTION_TYPE].
1.0.0 · Source§

impl<T, A> Ord for Arc<T, A>
where T: Ord + ?Sized, A: Allocator,

Source§

fn cmp(&self, other: &Arc<T, A>) -> Ordering

Comparison for two Arcs.

The two are compared by calling cmp() on their inner values.

§Examples
use std::sync::Arc;
use std::cmp::Ordering;

let five = Arc::new(5);

assert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
1.0.0 · Source§

impl<T, A> PartialEq for Arc<T, A>
where T: PartialEq + ?Sized, A: Allocator,

Source§

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

Equality for two Arcs.

Two Arcs are equal if their inner values are equal, even if they are stored in different allocation.

If T also implements Eq (implying reflexivity of equality), two Arcs that point to the same allocation are always equal.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five == Arc::new(5));
Source§

fn ne(&self, other: &Arc<T, A>) -> bool

Inequality for two Arcs.

Two Arcs are not equal if their inner values are not equal.

If T also implements Eq (implying reflexivity of equality), two Arcs that point to the same value are always equal.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five != Arc::new(6));
1.0.0 · Source§

impl<T, A> PartialOrd for Arc<T, A>
where T: PartialOrd + ?Sized, A: Allocator,

Source§

fn partial_cmp(&self, other: &Arc<T, A>) -> Option<Ordering>

Partial comparison for two Arcs.

The two are compared by calling partial_cmp() on their inner values.

§Examples
use std::sync::Arc;
use std::cmp::Ordering;

let five = Arc::new(5);

assert_eq!(Some(Ordering::Less), five.partial_cmp(&Arc::new(6)));
Source§

fn lt(&self, other: &Arc<T, A>) -> bool

Less-than comparison for two Arcs.

The two are compared by calling < on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five < Arc::new(6));
Source§

fn le(&self, other: &Arc<T, A>) -> bool

‘Less than or equal to’ comparison for two Arcs.

The two are compared by calling <= on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five <= Arc::new(5));
Source§

fn gt(&self, other: &Arc<T, A>) -> bool

Greater-than comparison for two Arcs.

The two are compared by calling > on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five > Arc::new(4));
Source§

fn ge(&self, other: &Arc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Arcs.

The two are compared by calling >= on their inner values.

§Examples
use std::sync::Arc;

let five = Arc::new(5);

assert!(five >= Arc::new(5));
Source§

impl<T> PayloadValidator for Arc<T>
where T: PayloadValidator + ?Sized, Arc<T>: Send + Sync + Unpin + 'static,

Source§

type Block = <T as PayloadValidator>::Block

The block type used by the engine.
Source§

type ExecutionData = <T as PayloadValidator>::ExecutionData

The execution payload type used by the engine.
Source§

fn ensure_well_formed_payload( &self, payload: <Arc<T> as PayloadValidator>::ExecutionData, ) -> Result<RecoveredBlock<<Arc<T> as PayloadValidator>::Block>, NewPayloadError>

Ensures that the given payload does not violate any consensus rules that concern the block’s layout. Read more
Source§

fn validate_block_post_execution_with_hashed_state( &self, _state_updates: &HashedPostState, _block: &RecoveredBlock<<Arc<T> as PayloadValidator>::Block>, ) -> Result<(), ConsensusError>

Verifies payload post-execution w.r.t. hashed state updates.
§

impl<T> Peers for Arc<T>
where T: Peers + ?Sized, Arc<T>: PeersInfo,

§

fn add_peer(&self, peer: FixedBytes<64>, tcp_addr: SocketAddr)

Adds a peer to the peer set with TCP SocketAddr.
§

fn add_peer_with_udp( &self, peer: FixedBytes<64>, tcp_addr: SocketAddr, udp_addr: SocketAddr, )

Adds a peer to the peer set with TCP and UDP SocketAddr.
§

fn add_trusted_peer_id(&self, peer: FixedBytes<64>)

Adds a trusted [PeerId] to the peer set. Read more
§

fn add_trusted_peer(&self, peer: FixedBytes<64>, tcp_addr: SocketAddr)

Adds a trusted peer to the peer set with TCP SocketAddr.
§

fn add_trusted_peer_with_udp( &self, peer: FixedBytes<64>, tcp_addr: SocketAddr, udp_addr: SocketAddr, )

Adds a trusted peer with TCP and UDP SocketAddr to the peer set.
§

fn add_peer_kind( &self, peer: FixedBytes<64>, kind: PeerKind, tcp_addr: SocketAddr, udp_addr: Option<SocketAddr>, )

Adds a peer to the known peer set, with the given kind.
§

fn get_trusted_peers( &self, ) -> impl Future<Output = Result<Vec<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for all connected [PeerKind::Trusted] peers.
§

fn get_basic_peers( &self, ) -> impl Future<Output = Result<Vec<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for all connected [PeerKind::Basic] peers.
§

fn get_peers_by_kind( &self, kind: PeerKind, ) -> impl Future<Output = Result<Vec<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for all connected peers with the given kind.
§

fn get_all_peers( &self, ) -> impl Future<Output = Result<Vec<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for all connected peers.
§

fn get_peer_by_id( &self, peer_id: FixedBytes<64>, ) -> impl Future<Output = Result<Option<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for the given peer id. Read more
§

fn get_peers_by_id( &self, peer_ids: Vec<FixedBytes<64>>, ) -> impl Future<Output = Result<Vec<PeerInfo>, NetworkError>> + Send

Returns the rpc [PeerInfo] for the given peers if they are connected. Read more
§

fn remove_peer(&self, peer: FixedBytes<64>, kind: PeerKind)

Removes a peer from the peer set that corresponds to given kind.
§

fn disconnect_peer(&self, peer: FixedBytes<64>)

Disconnect an existing connection to the given peer.
§

fn disconnect_peer_with_reason( &self, peer: FixedBytes<64>, reason: DisconnectReason, )

Disconnect an existing connection to the given peer using the provided reason
§

fn connect_peer(&self, peer: FixedBytes<64>, tcp_addr: SocketAddr)

Connect to the given peer. NOTE: if the maximum number out outbound sessions is reached, this won’t do anything. See reth_network::SessionManager::dial_outbound.
§

fn connect_peer_kind( &self, peer: FixedBytes<64>, kind: PeerKind, tcp_addr: SocketAddr, udp_addr: Option<SocketAddr>, )

Connects a peer to the known peer set, with the given kind.
§

fn reputation_change(&self, peer_id: FixedBytes<64>, kind: ReputationChangeKind)

Send a reputation change for the given peer.
§

fn reputation_by_id( &self, peer_id: FixedBytes<64>, ) -> impl Future<Output = Result<Option<i32>, NetworkError>> + Send

Get the reputation of a peer.
§

impl<T> PeersHandleProvider for Arc<T>
where T: PeersHandleProvider + ?Sized,

§

fn peers_handle(&self) -> &PeersHandle

Returns the [PeersHandle] that can be cloned and shared. Read more
§

impl<T> PeersInfo for Arc<T>
where T: PeersInfo + ?Sized, Arc<T>: Send + Sync,

§

fn num_connected_peers(&self) -> usize

Returns how many peers the network is currently connected to. Read more
§

fn local_node_record(&self) -> NodeRecord

Returns the Ethereum Node Record of the node.
§

fn local_enr(&self) -> Enr<SecretKey>

Returns the local ENR of the node.
1.0.0 · Source§

impl<T, A> Pointer for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

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

Formats the value using the given formatter. Read more
§

impl<N, T> Provider<N> for Arc<T>
where N: Network, T: Provider<N>, Arc<T>: Send + Sync,

§

fn root(&self) -> &RootProvider<N>

Returns the root provider.
§

fn builder() -> ProviderBuilder<Identity, Identity, N>
where Arc<T>: Sized,

Returns the ProviderBuilder to build on.
§

fn client(&self) -> &RpcClientInner

Returns the RPC client used to send requests. Read more
§

fn weak_client(&self) -> Weak<RpcClientInner>

Returns a Weak RPC client used to send requests. Read more
§

fn get_accounts(&self) -> ProviderCall<[(); 0], Vec<Address>>

Gets the accounts in the remote node. This is usually empty unless you’re using a local node.
§

fn get_blob_base_fee(&self) -> ProviderCall<[(); 0], Uint<128, 2>, u128>

Returns the base fee per blob gas (blob gas price) in wei.
§

fn get_block_number(&self) -> ProviderCall<[(); 0], Uint<64, 1>, u64>

Get the last block number available.
§

fn call(&self, tx: <N as Network>::TransactionRequest) -> EthCall<N, Bytes>

Execute a smart contract call with a transaction request and state overrides, without publishing a transaction. Read more
§

fn call_many<'req>( &self, bundles: &'req [Bundle], ) -> EthCallMany<'req, N, Vec<Vec<EthCallResponse>>>

Execute a list of [Bundle] against the provided StateContext and StateOverride, without publishing a transaction. Read more
§

fn simulate<'req>( &self, payload: &'req SimulatePayload, ) -> RpcWithBlock<&'req SimulatePayload, Vec<SimulatedBlock<<N as Network>::BlockResponse>>>

Executes an arbitrary number of transactions on top of the requested state. Read more
§

fn get_chain_id(&self) -> ProviderCall<[(); 0], Uint<64, 1>, u64>

Gets the chain ID.
§

fn create_access_list<'a>( &self, request: &'a <N as Network>::TransactionRequest, ) -> RpcWithBlock<&'a <N as Network>::TransactionRequest, AccessListResult>

Create an EIP-2930 access list.
§

fn estimate_gas( &self, tx: <N as Network>::TransactionRequest, ) -> EthCall<N, Uint<64, 1>, u64>

Create an [EthCall] future to estimate the gas required for a transaction. Read more
§

fn estimate_eip1559_fees_with<'life0, 'async_trait>( &'life0 self, estimator: Eip1559Estimator, ) -> Pin<Box<dyn Future<Output = Result<Eip1559Estimation, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Estimates the EIP1559 maxFeePerGas and maxPriorityFeePerGas fields. Read more
§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Eip1559Estimation, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Estimates the EIP1559 maxFeePerGas and maxPriorityFeePerGas fields. Read more
§

fn get_fee_history<'life0, 'life1, 'async_trait>( &'life0 self, block_count: u64, last_block: BlockNumberOrTag, reward_percentiles: &'life1 [f64], ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Returns a collection of historical gas information [FeeHistory] which can be used to calculate the EIP1559 fields maxFeePerGas and maxPriorityFeePerGas. block_count can range from 1 to 1024 blocks in a single request.
§

fn get_gas_price(&self) -> ProviderCall<[(); 0], Uint<128, 2>, u128>

Gets the current gas price in wei.
§

fn get_account(&self, address: Address) -> RpcWithBlock<Address, TrieAccount>

Retrieves account information (Account) for the given [Address] at the particular [BlockId].
§

fn get_balance(&self, address: Address) -> RpcWithBlock<Address, Uint<256, 4>>

Gets the balance of the account. Read more
§

fn get_block( &self, block: BlockId, ) -> EthGetBlock<<N as Network>::BlockResponse>

Gets a block by either its hash, tag, or number Read more
§

fn get_block_by_hash( &self, hash: FixedBytes<32>, ) -> EthGetBlock<<N as Network>::BlockResponse>

Gets a block by its [BlockHash] Read more
§

fn get_block_by_number( &self, number: BlockNumberOrTag, ) -> EthGetBlock<<N as Network>::BlockResponse>

Gets a block by its [BlockNumberOrTag] Read more
§

fn get_block_transaction_count_by_hash<'life0, 'async_trait>( &'life0 self, hash: FixedBytes<32>, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Returns the number of transactions in a block from a block matching the given block hash.
§

fn get_block_transaction_count_by_number<'life0, 'async_trait>( &'life0 self, block_number: BlockNumberOrTag, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Returns the number of transactions in a block matching the given block number.
§

fn get_block_receipts( &self, block: BlockId, ) -> ProviderCall<(BlockId,), Option<Vec<<N as Network>::ReceiptResponse>>>

Gets the selected block [BlockId] receipts.
§

fn get_code_at(&self, address: Address) -> RpcWithBlock<Address, Bytes>

Gets the bytecode located at the corresponding [Address].
§

fn watch_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<(Uint<256, 4>,), Vec<FixedBytes<32>>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Watch for new blocks by polling the provider with eth_getFilterChanges. Read more
§

fn watch_full_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<WatchBlocks<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Watch for new blocks by polling the provider with eth_getFilterChanges and transforming the returned block hashes into full blocks bodies. Read more
§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<(Uint<256, 4>,), Vec<FixedBytes<32>>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Watch for new pending transaction by polling the provider with eth_getFilterChanges. Read more
§

fn watch_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<(Uint<256, 4>,), Vec<Log>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Watch for new logs using the given filter by polling the provider with eth_getFilterChanges. Read more
§

fn watch_full_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<(Uint<256, 4>,), Vec<<N as Network>::TransactionResponse>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Watch for new pending transaction bodies by polling the provider with eth_getFilterChanges. Read more
§

fn get_filter_changes_dyn<'life0, 'async_trait>( &'life0 self, id: Uint<256, 4>, ) -> Pin<Box<dyn Future<Output = Result<FilterChanges, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Get a list of values that have been added since the last poll. Read more
§

fn get_filter_logs<'life0, 'async_trait>( &'life0 self, id: Uint<256, 4>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Retrieves a Vec<Log> for the given filter ID.
§

fn uninstall_filter<'life0, 'async_trait>( &'life0 self, id: Uint<256, 4>, ) -> Pin<Box<dyn Future<Output = Result<bool, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Request provider to uninstall the filter with the given ID.
§

fn watch_pending_transaction<'life0, 'async_trait>( &'life0 self, config: PendingTransactionConfig, ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction, PendingTransactionError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Watch for the confirmation of a single pending transaction with the given configuration. Read more
§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Retrieves a Vec<Log> with the given [Filter].
§

fn get_proof( &self, address: Address, keys: Vec<FixedBytes<32>>, ) -> RpcWithBlock<(Address, Vec<FixedBytes<32>>), EIP1186AccountProofResponse>

Get the account and storage values of the specified account including the merkle proofs. Read more
§

fn get_storage_at( &self, address: Address, key: Uint<256, 4>, ) -> RpcWithBlock<(Address, Uint<256, 4>), Uint<256, 4>>

Gets the specified storage value from [Address].
§

fn get_transaction_by_sender_nonce( &self, sender: Address, nonce: u64, ) -> ProviderCall<(Address, Uint<64, 1>), Option<<N as Network>::TransactionResponse>>

Gets a transaction by its sender and nonce. Read more
§

fn get_transaction_by_hash( &self, hash: FixedBytes<32>, ) -> ProviderCall<(FixedBytes<32>,), Option<<N as Network>::TransactionResponse>>

Gets a transaction by its [TxHash].
§

fn get_transaction_by_block_hash_and_index( &self, block_hash: FixedBytes<32>, index: usize, ) -> ProviderCall<(FixedBytes<32>, Index), Option<<N as Network>::TransactionResponse>>

Gets a transaction by block hash and transaction index position.
§

fn get_raw_transaction_by_block_hash_and_index( &self, block_hash: FixedBytes<32>, index: usize, ) -> ProviderCall<(FixedBytes<32>, Index), Option<Bytes>>

Gets a raw transaction by block hash and transaction index position.
§

fn get_transaction_by_block_number_and_index( &self, block_number: BlockNumberOrTag, index: usize, ) -> ProviderCall<(BlockNumberOrTag, Index), Option<<N as Network>::TransactionResponse>>

Gets a transaction by block number and transaction index position.
§

fn get_raw_transaction_by_block_number_and_index( &self, block_number: BlockNumberOrTag, index: usize, ) -> ProviderCall<(BlockNumberOrTag, Index), Option<Bytes>>

Gets a raw transaction by block number and transaction index position.
§

fn get_raw_transaction_by_hash( &self, hash: FixedBytes<32>, ) -> ProviderCall<(FixedBytes<32>,), Option<Bytes>>

Returns the EIP-2718 encoded transaction if it exists, see also Decodable2718. Read more
§

fn get_transaction_count( &self, address: Address, ) -> RpcWithBlock<Address, Uint<64, 1>, u64>

Gets the transaction count (AKA “nonce”) of the corresponding address.
§

fn get_transaction_receipt( &self, hash: FixedBytes<32>, ) -> ProviderCall<(FixedBytes<32>,), Option<<N as Network>::ReceiptResponse>>

Gets a transaction receipt if it exists, by its [TxHash].
§

fn get_uncle<'life0, 'async_trait>( &'life0 self, tag: BlockId, idx: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Gets an uncle block through the tag [BlockId] and index u64.
§

fn get_uncle_count<'life0, 'async_trait>( &'life0 self, tag: BlockId, ) -> Pin<Box<dyn Future<Output = Result<u64, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Gets the number of uncles for the block specified by the tag [BlockId].
§

fn get_max_priority_fee_per_gas( &self, ) -> ProviderCall<[(); 0], Uint<128, 2>, u128>

Returns a suggestion for the current maxPriorityFeePerGas in wei.
§

fn new_block_filter<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Uint<256, 4>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Notify the provider that we are interested in new blocks. Read more
§

fn new_filter<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<Uint<256, 4>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Notify the provider that we are interested in logs that match the given filter. Read more
§

fn new_pending_transactions_filter<'life0, 'async_trait>( &'life0 self, full: bool, ) -> Pin<Box<dyn Future<Output = Result<Uint<256, 4>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Notify the provider that we are interested in new pending transactions. Read more
§

fn send_raw_transaction<'life0, 'life1, 'async_trait>( &'life0 self, encoded_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Broadcasts a raw transaction RLP bytes to the network. Read more
§

fn send_raw_transaction_conditional<'life0, 'life1, 'async_trait>( &'life0 self, encoded_tx: &'life1 [u8], conditional: TransactionConditional, ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Broadcasts a raw transaction RLP bytes with a conditional [TransactionConditional] to the network. Read more
§

fn send_transaction<'life0, 'async_trait>( &'life0 self, tx: <N as Network>::TransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Broadcasts a transaction to the network. Read more
§

fn send_tx_envelope<'life0, 'async_trait>( &'life0 self, tx: <N as Network>::TxEnvelope, ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Broadcasts a transaction envelope to the network. Read more
§

fn sign_transaction<'life0, 'async_trait>( &'life0 self, tx: <N as Network>::TransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<Bytes, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Signs a transaction that can be submitted to the network later using [Provider::send_raw_transaction]. Read more
§

fn subscribe_blocks( &self, ) -> GetSubscription<(SubscriptionKind,), <N as Network>::HeaderResponse>

Subscribe to a stream of new block headers. Read more
§

fn subscribe_full_blocks(&self) -> SubFullBlocks<N>

Subscribe to a stream of full block bodies. Read more
§

fn subscribe_pending_transactions( &self, ) -> GetSubscription<(SubscriptionKind,), FixedBytes<32>>

Subscribe to a stream of pending transaction hashes. Read more
§

fn subscribe_full_pending_transactions( &self, ) -> GetSubscription<(SubscriptionKind, Params), <N as Network>::TransactionResponse>

Subscribe to a stream of pending transaction bodies. Read more
§

fn subscribe_logs( &self, filter: &Filter, ) -> GetSubscription<(SubscriptionKind, Params), Log>

Subscribe to a stream of logs matching given filter. Read more
§

fn unsubscribe<'life0, 'async_trait>( &'life0 self, id: FixedBytes<32>, ) -> Pin<Box<dyn Future<Output = Result<(), RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Cancels a subscription given the subscription ID.
§

fn syncing(&self) -> ProviderCall<[(); 0], SyncStatus>

Gets syncing info.
§

fn get_client_version(&self) -> ProviderCall<[(); 0], String>

Gets the client version.
§

fn get_sha3(&self, data: &[u8]) -> ProviderCall<(String,), FixedBytes<32>>

Gets the Keccak-256 hash of the given data.
§

fn get_net_version(&self) -> ProviderCall<[(); 0], Uint<64, 1>, u64>

Gets the network ID. Same as eth_chainId.
§

fn raw_request<'life0, 'async_trait, P, R>( &'life0 self, method: Cow<'static, str>, params: P, ) -> Pin<Box<dyn Future<Output = Result<R, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, P: RpcSend + 'async_trait, R: RpcRecv + 'async_trait, Arc<T>: Sized + 'async_trait,

Sends a raw JSON-RPC request. Read more
§

fn raw_request_dyn<'life0, 'life1, 'async_trait>( &'life0 self, method: Cow<'static, str>, params: &'life1 RawValue, ) -> Pin<Box<dyn Future<Output = Result<Box<RawValue>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Sends a raw JSON-RPC request with type-erased parameters and return. Read more
§

fn transaction_request(&self) -> <N as Network>::TransactionRequest

Creates a new TransactionRequest.
§

fn erased(self) -> DynProvider<N>
where Self: Sized + 'static,

Returns a type erased provider wrapped in Arc. See [DynProvider]. Read more
§

fn multicall(&self) -> MulticallBuilder<Empty, &Self, N>
where Self: Sized,

Execute a multicall by leveraging the [MulticallBuilder]. Read more
§

fn get_filter_changes<'life0, 'async_trait, R>( &'life0 self, id: Uint<256, 4>, ) -> Pin<Box<dyn Future<Output = Result<Vec<R>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sized + 'async_trait, R: 'async_trait + RpcRecv,

Get a list of values that have been added since the last poll. Read more
§

fn subscribe<P, R>(&self, params: P) -> GetSubscription<P, R>
where P: RpcSend, R: RpcRecv, Self: Sized,

Subscribe to an RPC event.
§

impl<T> PruneCheckpointReader for Arc<T>
where T: PruneCheckpointReader + ?Sized, Arc<T>: Send + Sync,

§

fn get_prune_checkpoint( &self, segment: PruneSegment, ) -> Result<Option<PruneCheckpoint>, ProviderError>

Fetch the prune checkpoint for the given segment.
§

fn get_prune_checkpoints( &self, ) -> Result<Vec<(PruneSegment, PruneCheckpoint)>, ProviderError>

Fetch all the prune checkpoints.
§

impl<T> PruneCheckpointWriter for Arc<T>
where T: PruneCheckpointWriter + ?Sized, Arc<T>: Send + Sync,

§

fn save_prune_checkpoint( &self, segment: PruneSegment, checkpoint: PruneCheckpoint, ) -> Result<(), ProviderError>

Save prune checkpoint.
§

impl<T> ReceiptBuilder for Arc<T>
where T: ReceiptBuilder + ?Sized,

§

type Transaction = <T as ReceiptBuilder>::Transaction

Transaction type.
§

type Receipt = <T as ReceiptBuilder>::Receipt

Receipt type.
§

fn build_receipt<E>( &self, ctx: ReceiptBuilderCtx<'_, <Arc<T> as ReceiptBuilder>::Transaction, E>, ) -> <Arc<T> as ReceiptBuilder>::Receipt
where E: Evm,

Builds a receipt given a transaction and the result of the execution.
§

impl<T> ReceiptProvider for Arc<T>
where T: ReceiptProvider + ?Sized, Arc<T>: Send + Sync,

§

type Receipt = <T as ReceiptProvider>::Receipt

The receipt type.
§

fn receipt( &self, id: u64, ) -> Result<Option<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>

Get receipt by transaction number Read more
§

fn receipt_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>

Get receipt by transaction hash. Read more
§

fn receipts_by_block( &self, block: HashOrNumber, ) -> Result<Option<Vec<<Arc<T> as ReceiptProvider>::Receipt>>, ProviderError>

Get receipts by block num or hash. Read more
§

fn receipts_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<<Arc<T> as ReceiptProvider>::Receipt>, ProviderError>

Get receipts by tx range.
§

impl<T> Recorder for Arc<T>
where T: Recorder + ?Sized,

§

fn describe_counter( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a counter. Read more
§

fn describe_gauge( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a gauge. Read more
§

fn describe_histogram( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a histogram. Read more
§

fn register_counter(&self, key: &Key, metadata: &Metadata<'_>) -> Counter

Registers a counter.
§

fn register_gauge(&self, key: &Key, metadata: &Metadata<'_>) -> Gauge

Registers a gauge.
§

fn register_histogram(&self, key: &Key, metadata: &Metadata<'_>) -> Histogram

Registers a histogram.
Source§

impl<T> Serialize for Arc<T>
where T: Serialize + ?Sized,

This impl requires the "rc" Cargo feature of Serde.

Serializing a data structure containing Arc will serialize a copy of the contents of the Arc each time the Arc is referenced within the data structure. Serialization will not attempt to deduplicate these repeated data.

Source§

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
Source§

impl<T, U> SerializeAs<Arc<T>> for Arc<U>
where U: SerializeAs<T>,

Source§

fn serialize_as<S>( source: &Arc<T>, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
§

impl<Request, S> Service<Request> for Arc<S>
where S: Service<Request> + ?Sized,

§

type Response = <S as Service<Request>>::Response

Responses given by the service.
§

type Error = <S as Service<Request>>::Error

Errors produced by the service. Read more
§

type Future = <S as Service<Request>>::Future

The future response value.
§

fn call(&self, req: Request) -> <Arc<S> as Service<Request>>::Future

Process the request and return the response asynchronously. call takes &self instead of mut &self because: Read more
§

impl<T> SignedTransaction for Arc<T>
where T: SignedTransaction + ?Sized, Arc<T>: Send + Sync + Unpin + Clone + Debug + PartialEq + Eq + Hash + Encodable + Decodable + Encodable2718 + Decodable2718 + Transaction + MaybeSerde + InMemorySize,

§

fn tx_hash(&self) -> &FixedBytes<32>

Returns reference to transaction hash.
§

fn is_broadcastable_in_full(&self) -> bool

Returns whether this transaction type can be broadcasted as full transaction over the network. Read more
§

fn recover_signer(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash. Read more
§

fn try_recover(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash. Read more
§

fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash without ensuring that the signature has a low s value. Read more
§

fn try_recover_unchecked(&self) -> Result<Address, RecoveryError>

Recover signer from signature and hash without ensuring that the signature has a low s value. Read more
§

fn recover_signer_unchecked_with_buf( &self, buf: &mut Vec<u8>, ) -> Result<Address, RecoveryError>

Same as [Self::recover_signer_unchecked] but receives a buffer to operate on. This is used during batch recovery to avoid allocating a new buffer for each transaction.
§

fn recalculate_hash(&self) -> FixedBytes<32>

Calculate transaction hash, eip2728 transaction does not contain rlp header and start with tx type.
§

fn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError>

Tries to recover signer and return [Recovered] by cloning the type.
§

fn try_into_recovered(self) -> Result<Recovered<Self>, Self>

Tries to recover signer and return [Recovered]. Read more
§

fn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>

Consumes the type, recover signer and return [Recovered] without ensuring that the signature has a low s value (EIP-2). Read more
§

fn with_signer(self, signer: Address) -> Recovered<Self>

Returns the [Recovered] transaction with the given sender. Read more
§

impl<Sig, U> SignerSync<Sig> for Arc<U>
where U: SignerSync<Sig> + ?Sized,

§

fn sign_hash_sync(&self, hash: &FixedBytes<32>) -> Result<Sig, Error>

Signs the given hash.
§

fn sign_message_sync(&self, message: &[u8]) -> Result<Sig, Error>

Signs the hash of the provided message after prefixing it, as specified in EIP-191.
§

fn chain_id_sync(&self) -> Option<u64>

Returns the signer’s chain ID.
§

impl<T> SnapClient for Arc<T>
where T: SnapClient + ?Sized, Arc<T>: DownloadClient,

§

type Output = <T as SnapClient>::Output

The output future type for account range requests
§

fn get_account_range( &self, request: GetAccountRangeMessage, ) -> <Arc<T> as SnapClient>::Output

Sends the account range request to the p2p network and returns the account range response received from a peer.
§

fn get_account_range_with_priority( &self, request: GetAccountRangeMessage, priority: Priority, ) -> <Arc<T> as SnapClient>::Output

Sends the account range request to the p2p network with priority set and returns the account range response received from a peer.
§

impl<Sp> Spawn for Arc<Sp>
where Sp: Spawn + ?Sized,

§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
§

impl<T> Specifier<DynSolType> for Arc<T>
where T: Specifier<DynSolType> + ?Sized,

§

fn resolve(&self) -> Result<DynSolType, Error>

Resolve the type into a value.
§

impl<T> StageCheckpointReader for Arc<T>
where T: StageCheckpointReader + ?Sized, Arc<T>: Send + Sync,

§

fn get_stage_checkpoint( &self, id: StageId, ) -> Result<Option<StageCheckpoint>, ProviderError>

Fetch the checkpoint for the given stage.
§

fn get_stage_checkpoint_progress( &self, id: StageId, ) -> Result<Option<Vec<u8>>, ProviderError>

Get stage checkpoint progress.
§

fn get_all_checkpoints( &self, ) -> Result<Vec<(String, StageCheckpoint)>, ProviderError>

Reads all stage checkpoints and returns a list with the name of the stage and the checkpoint data.
§

impl<T> StageCheckpointWriter for Arc<T>
where T: StageCheckpointWriter + ?Sized, Arc<T>: Send + Sync,

§

fn save_stage_checkpoint( &self, id: StageId, checkpoint: StageCheckpoint, ) -> Result<(), ProviderError>

Save stage checkpoint.
§

fn save_stage_checkpoint_progress( &self, id: StageId, checkpoint: Vec<u8>, ) -> Result<(), ProviderError>

Save stage checkpoint progress.
§

fn update_pipeline_stages( &self, block_number: u64, drop_stage_checkpoint: bool, ) -> Result<(), ProviderError>

Update all pipeline sync stage progress.
§

impl<T> StateProofProvider for Arc<T>
where T: StateProofProvider + ?Sized, Arc<T>: Send + Sync,

§

fn proof( &self, input: TrieInput, address: Address, slots: &[FixedBytes<32>], ) -> Result<AccountProof, ProviderError>

Get account and storage proofs of target keys in the HashedPostState on top of the current state.
§

fn multiproof( &self, input: TrieInput, targets: MultiProofTargets, ) -> Result<MultiProof, ProviderError>

Generate [MultiProof] for target hashed account and corresponding hashed storage slot keys.
§

fn witness( &self, input: TrieInput, target: HashedPostState, ) -> Result<Vec<Bytes>, ProviderError>

Get trie witness for provided state.
§

impl<T> StateProvider for Arc<T>
where T: StateProvider + ?Sized, Arc<T>: BlockHashReader + AccountReader + StateRootProvider + StorageRootProvider + StateProofProvider + HashedPostStateProvider + Send + Sync,

§

fn storage( &self, account: Address, storage_key: FixedBytes<32>, ) -> Result<Option<Uint<256, 4>>, ProviderError>

Get storage of given account.
§

fn bytecode_by_hash( &self, code_hash: &FixedBytes<32>, ) -> Result<Option<Bytecode>, ProviderError>

Get account code by its hash
§

fn account_code( &self, addr: &Address, ) -> Result<Option<Bytecode>, ProviderError>

Get account code by its address. Read more
§

fn account_balance( &self, addr: &Address, ) -> Result<Option<Uint<256, 4>>, ProviderError>

Get account balance by its address. Read more
§

fn account_nonce(&self, addr: &Address) -> Result<Option<u64>, ProviderError>

Get account nonce by its address. Read more
§

impl<T> StateProviderFactory for Arc<T>
where T: StateProviderFactory + ?Sized, Arc<T>: BlockIdReader + Send + Sync,

§

fn latest(&self) -> Result<Box<dyn StateProvider>, ProviderError>

Storage provider for latest block.
§

fn state_by_block_id( &self, block_id: BlockId, ) -> Result<Box<dyn StateProvider>, ProviderError>

Returns a [StateProvider] indexed by the given [BlockId]. Read more
§

fn state_by_block_number_or_tag( &self, number_or_tag: BlockNumberOrTag, ) -> Result<Box<dyn StateProvider>, ProviderError>

Returns a [StateProvider] indexed by the given block number or tag. Read more
§

fn history_by_block_number( &self, block: u64, ) -> Result<Box<dyn StateProvider>, ProviderError>

Returns a historical [StateProvider] indexed by the given historic block number. Read more
§

fn history_by_block_hash( &self, block: FixedBytes<32>, ) -> Result<Box<dyn StateProvider>, ProviderError>

Returns a historical [StateProvider] indexed by the given block hash. Read more
§

fn state_by_block_hash( &self, block: FixedBytes<32>, ) -> Result<Box<dyn StateProvider>, ProviderError>

Returns any [StateProvider] with matching block hash. Read more
§

fn pending(&self) -> Result<Box<dyn StateProvider>, ProviderError>

Storage provider for pending state. Read more
§

fn pending_state_by_hash( &self, block_hash: FixedBytes<32>, ) -> Result<Option<Box<dyn StateProvider>>, ProviderError>

Storage provider for pending state for the given block hash. Read more
§

impl<T> StateReader for Arc<T>
where T: StateReader + ?Sized, Arc<T>: Send + Sync,

§

type Receipt = <T as StateReader>::Receipt

Receipt type in [ExecutionOutcome].
§

fn get_state( &self, block: u64, ) -> Result<Option<ExecutionOutcome<<Arc<T> as StateReader>::Receipt>>, ProviderError>

Get the [ExecutionOutcome] for the given block
§

impl<T> StateRootProvider for Arc<T>
where T: StateRootProvider + ?Sized, Arc<T>: Send + Sync,

§

fn state_root( &self, hashed_state: HashedPostState, ) -> Result<FixedBytes<32>, ProviderError>

Returns the state root of the BundleState on top of the current state. Read more
§

fn state_root_from_nodes( &self, input: TrieInput, ) -> Result<FixedBytes<32>, ProviderError>

Returns the state root of the HashedPostState on top of the current state but reuses the intermediate nodes to speed up the computation. It’s up to the caller to construct the prefix sets and inform the provider of the trie paths that have changes.
§

fn state_root_with_updates( &self, hashed_state: HashedPostState, ) -> Result<(FixedBytes<32>, TrieUpdates), ProviderError>

Returns the state root of the HashedPostState on top of the current state with trie updates to be committed to the database.
§

fn state_root_from_nodes_with_updates( &self, input: TrieInput, ) -> Result<(FixedBytes<32>, TrieUpdates), ProviderError>

Returns state root and trie updates. See [StateRootProvider::state_root_from_nodes] for more info.
§

impl<U> StatsReader for Arc<U>
where U: StatsReader + ?Sized, Arc<U>: Send + Sync,

§

fn count_entries<T>(&self) -> Result<usize, ProviderError>
where T: Table,

Fetch the number of entries in the corresponding [Table]. Depending on the provider, it may route to different data sources other than [Table].
§

impl<T> StorageChangeSetReader for Arc<T>
where T: StorageChangeSetReader + ?Sized, Arc<T>: Send + Sync,

§

fn storage_changeset( &self, block_number: u64, ) -> Result<Vec<(BlockNumberAddress, StorageEntry)>, ProviderError>

Iterate over storage changesets and return the storage state from before this block.
§

impl<T> StorageReader for Arc<T>
where T: StorageReader + ?Sized, Arc<T>: Send + Sync,

§

fn plain_state_storages( &self, addresses_with_keys: impl IntoIterator<Item = (Address, impl IntoIterator<Item = FixedBytes<32>>)>, ) -> Result<Vec<(Address, Vec<StorageEntry>)>, ProviderError>

Get plainstate storages for addresses and storage keys.
§

fn changed_storages_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<Address, BTreeSet<FixedBytes<32>>>, ProviderError>

Iterate over storage changesets and return all storage slots that were changed.
§

fn changed_storages_and_blocks_with_range( &self, range: RangeInclusive<u64>, ) -> Result<BTreeMap<(Address, FixedBytes<32>), Vec<u64>>, ProviderError>

Iterate over storage changesets and return all storage slots that were changed alongside each specific set of blocks. Read more
§

impl<T> StorageRootProvider for Arc<T>
where T: StorageRootProvider + ?Sized, Arc<T>: Send + Sync,

§

fn storage_root( &self, address: Address, hashed_storage: HashedStorage, ) -> Result<FixedBytes<32>, ProviderError>

Returns the storage root of the HashedStorage for target address on top of the current state.
§

fn storage_proof( &self, address: Address, slot: FixedBytes<32>, hashed_storage: HashedStorage, ) -> Result<StorageProof, ProviderError>

Returns the storage proof of the HashedStorage for target slot on top of the current state.
§

fn storage_multiproof( &self, address: Address, slots: &[FixedBytes<32>], hashed_storage: HashedStorage, ) -> Result<StorageMultiProof, ProviderError>

Returns the storage multiproof for target slots.
§

impl<T> StorageTrieWriter for Arc<T>
where T: StorageTrieWriter + ?Sized, Arc<T>: Send + Sync,

§

fn write_storage_trie_updates( &self, storage_tries: &HashMap<FixedBytes<32>, StorageTrieUpdates, FbBuildHasher<32>>, ) -> Result<usize, ProviderError>

Writes storage trie updates from the given storage trie map. Read more
§

fn write_individual_storage_trie_updates( &self, hashed_address: FixedBytes<32>, updates: &StorageTrieUpdates, ) -> Result<usize, ProviderError>

Writes storage trie updates for the given hashed address.
§

impl<S> Strategy for Arc<S>
where S: Strategy + ?Sized,

§

type Tree = <S as Strategy>::Tree

The value tree generated by this Strategy.
§

type Value = <S as Strategy>::Value

The type of value used by functions under test generated by this Strategy. Read more
§

fn new_tree( &self, runner: &mut TestRunner, ) -> Result<<Arc<S> as Strategy>::Tree, Reason>

Generate a new value tree from the given runner. Read more
§

fn prop_map<O, F>(self, fun: F) -> Map<Self, F>
where O: Debug, F: Fn(Self::Value) -> O, Self: Sized,

Returns a strategy which produces values transformed by the function fun. Read more
§

fn prop_map_into<O>(self) -> MapInto<Self, O>
where O: Debug, Self: Sized, Self::Value: Into<O>,

Returns a strategy which produces values of type O by transforming Self with Into<O>. Read more
§

fn prop_perturb<O, F>(self, fun: F) -> Perturb<Self, F>
where O: Debug, F: Fn(Self::Value, TestRng) -> O, Self: Sized,

Returns a strategy which produces values transformed by the function fun, which is additionally given a random number generator. Read more
§

fn prop_flat_map<S, F>(self, fun: F) -> Flatten<Map<Self, F>>
where S: Strategy, F: Fn(Self::Value) -> S, Self: Sized,

Maps values produced by this strategy into new strategies and picks values from those strategies. Read more
§

fn prop_ind_flat_map<S, F>(self, fun: F) -> IndFlatten<Map<Self, F>>
where S: Strategy, F: Fn(Self::Value) -> S, Self: Sized,

Maps values produced by this strategy into new strategies and picks values from those strategies while considering the new strategies to be independent. Read more
§

fn prop_ind_flat_map2<S, F>(self, fun: F) -> IndFlattenMap<Self, F>
where S: Strategy, F: Fn(Self::Value) -> S, Self: Sized,

Similar to prop_ind_flat_map(), but produces 2-tuples with the input generated from self in slot 0 and the derived strategy in slot 1. Read more
§

fn prop_filter<R, F>(self, whence: R, fun: F) -> Filter<Self, F>
where R: Into<Reason>, F: Fn(&Self::Value) -> bool, Self: Sized,

Returns a strategy which only produces values accepted by fun. Read more
§

fn prop_filter_map<F, O>( self, whence: impl Into<Reason>, fun: F, ) -> FilterMap<Self, F>
where F: Fn(Self::Value) -> Option<O>, O: Debug, Self: Sized,

Returns a strategy which only produces transformed values where fun returns Some(value) and rejects those where fun returns None. Read more
§

fn prop_union(self, other: Self) -> Union<Self>
where Self: Sized,

Returns a strategy which picks uniformly from self and other. Read more
§

fn prop_recursive<R, F>( self, depth: u32, desired_size: u32, expected_branch_size: u32, recurse: F, ) -> Recursive<Self::Value, F>
where R: Strategy<Value = Self::Value> + 'static, F: Fn(BoxedStrategy<Self::Value>) -> R, Self: Sized + 'static,

Generate a recursive structure with self items as leaves. Read more
§

fn prop_shuffle(self) -> Shuffle<Self>
where Self: Sized, Self::Value: Shuffleable,

Shuffle the contents of the values produced by this strategy. Read more
§

fn boxed(self) -> BoxedStrategy<Self::Value>
where Self: Sized + 'static,

Erases the type of this Strategy so it can be passed around as a simple trait object. Read more
§

fn sboxed(self) -> SBoxedStrategy<Self::Value>
where Self: Sized + Send + Sync + 'static,

Erases the type of this Strategy so it can be passed around as a simple trait object. Read more
§

fn no_shrink(self) -> NoShrink<Self>
where Self: Sized,

Wraps this strategy to prevent values from being subject to shrinking. Read more
§

impl<S> Subscriber for Arc<S>
where S: Subscriber + ?Sized,

§

fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest

Registers a new callsite with this subscriber, returning whether or not the subscriber is interested in being notified about the callsite. Read more
§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Returns true if a span or event with the specified metadata would be recorded. Read more
§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns the highest verbosity level that this Subscriber will enable, or None, if the subscriber does not implement level-based filtering or chooses not to implement this method. Read more
§

fn new_span(&self, span: &Attributes<'_>) -> Id

Visit the construction of a new span, returning a new span ID for the span being constructed. Read more
§

fn record(&self, span: &Id, values: &Record<'_>)

Record a set of values on a span. Read more
§

fn record_follows_from(&self, span: &Id, follows: &Id)

Adds an indication that span follows from the span with the id follows. Read more
§

fn event_enabled(&self, event: &Event<'_>) -> bool

Determine if an [Event] should be recorded. Read more
§

fn event(&self, event: &Event<'_>)

Records that an Event has occurred. Read more
§

fn enter(&self, span: &Id)

Records that a span has been entered. Read more
§

fn exit(&self, span: &Id)

Records that a span has been exited. Read more
§

fn clone_span(&self, id: &Id) -> Id

Notifies the subscriber that a span ID has been cloned. Read more
§

fn try_close(&self, id: Id) -> bool

Notifies the subscriber that a span ID has been dropped, and returns true if there are now 0 IDs that refer to that span. Read more
§

fn drop_span(&self, id: Id)

👎Deprecated since 0.1.2: use Subscriber::try_close instead
This method is deprecated. Read more
§

fn current_span(&self) -> Current

Returns a type representing this subscriber’s view of the current span. Read more
§

unsafe fn downcast_raw(&self, id: TypeId) -> Option<*const ()>

If self is the same type as the provided TypeId, returns an untyped *const pointer to that type. Otherwise, returns None. Read more
§

fn on_register_dispatch(&self, subscriber: &Dispatch)

Invoked when this subscriber becomes a [Dispatch]. Read more
§

impl<T> SyncStateProvider for Arc<T>
where T: SyncStateProvider + ?Sized, Arc<T>: Send + Sync,

§

fn is_syncing(&self) -> bool

Returns true if the network is undergoing sync.
§

fn is_initially_syncing(&self) -> bool

Returns true if the network is undergoing an initial (pipeline) sync.
§

impl<T> TaskSpawner for Arc<T>
where T: TaskSpawner + ?Sized, Arc<T>: Send + Sync + Unpin + Debug + DynClone,

§

fn spawn(&self, fut: Pin<Box<dyn Future<Output = ()> + Send>>) -> JoinHandle<()>

Spawns the task onto the runtime. See also [Handle::spawn].
§

fn spawn_critical( &self, name: &'static str, fut: Pin<Box<dyn Future<Output = ()> + Send>>, ) -> JoinHandle<()>

This spawns a critical task onto the runtime.
§

fn spawn_blocking( &self, fut: Pin<Box<dyn Future<Output = ()> + Send>>, ) -> JoinHandle<()>

Spawns a blocking task onto the runtime.
§

fn spawn_critical_blocking( &self, name: &'static str, fut: Pin<Box<dyn Future<Output = ()> + Send>>, ) -> JoinHandle<()>

This spawns a critical blocking task onto the runtime.
§

impl<T> TaskSpawnerExt for Arc<T>
where T: TaskSpawnerExt + ?Sized, Arc<T>: Send + Sync + Unpin + Debug + DynClone,

§

fn spawn_critical_with_graceful_shutdown_signal<F>( &self, name: &'static str, f: impl FnOnce(GracefulShutdown) -> F, ) -> JoinHandle<()>
where F: Future<Output = ()> + Send + 'static,

This spawns a critical task onto the runtime. Read more
§

fn spawn_with_graceful_shutdown_signal<F>( &self, f: impl FnOnce(GracefulShutdown) -> F, ) -> JoinHandle<()>
where F: Future<Output = ()> + Send + 'static,

This spawns a regular task onto the runtime. Read more
§

impl<T> Transaction for Arc<T>
where T: Transaction + ?Sized,

§

type AccessListItem = <T as Transaction>::AccessListItem

§

type Authorization = <T as Transaction>::Authorization

§

fn tx_type(&self) -> u8

Returns the transaction type. Read more
§

fn caller(&self) -> Address

Caller aka Author aka transaction signer. Read more
§

fn gas_limit(&self) -> u64

The maximum amount of gas the transaction can use. Read more
§

fn value(&self) -> Uint<256, 4>

The value sent to the receiver of [TxKind::Call][primitives::TxKind::Call]. Read more
§

fn input(&self) -> &Bytes

Returns the input data of the transaction. Read more
§

fn nonce(&self) -> u64

The nonce of the transaction. Read more
§

fn kind(&self) -> TxKind

Transaction kind. It can be Call or Create. Read more
§

fn chain_id(&self) -> Option<u64>

Chain Id is optional for legacy transactions. Read more
§

fn gas_price(&self) -> u128

Gas price for the transaction. It is only applicable for Legacy and EIP-2930 transactions. For Eip1559 it is max_fee_per_gas.
§

fn access_list( &self, ) -> Option<impl Iterator<Item = &<Arc<T> as Transaction>::AccessListItem>>

Access list for the transaction. Read more
§

fn blob_versioned_hashes(&self) -> &[FixedBytes<32>]

Returns vector of fixed size hash(32 bytes) Read more
§

fn max_fee_per_blob_gas(&self) -> u128

Max fee per data gas Read more
§

fn total_blob_gas(&self) -> u64

Total gas for all blobs. Max number of blocks is already checked so we dont need to check for overflow.
§

fn calc_max_data_fee(&self) -> Uint<256, 4>

Calculates the maximum [EIP-4844] data_fee of the transaction. Read more
§

fn authorization_list_len(&self) -> usize

Returns length of the authorization list. Read more
§

fn authorization_list( &self, ) -> impl Iterator<Item = &<Arc<T> as Transaction>::Authorization>

List of authorizations, that contains the signature that authorizes this caller to place the code to signer account. Read more
§

fn max_fee_per_gas(&self) -> u128

Returns maximum fee that can be paid for the transaction.
§

fn max_priority_fee_per_gas(&self) -> Option<u128>

Maximum priority fee per gas.
§

fn effective_gas_price(&self, base_fee: u128) -> u128

Returns effective gas price is gas price field for Legacy and Eip2930 transaction. Read more
§

impl<T> Transaction for Arc<T>
where T: Transaction + ?Sized, Arc<T>: Typed2718 + Debug + Any + Send + Sync + 'static,

§

fn chain_id(&self) -> Option<u64>

Get chain_id.
§

fn nonce(&self) -> u64

Get nonce.
§

fn gas_limit(&self) -> u64

Get gas_limit.
§

fn gas_price(&self) -> Option<u128>

Get gas_price.
§

fn max_fee_per_gas(&self) -> u128

For dynamic fee transactions returns the maximum fee per gas the caller is willing to pay. Read more
§

fn max_priority_fee_per_gas(&self) -> Option<u128>

For dynamic fee transactions returns the Priority fee the caller is paying to the block author. Read more
§

fn max_fee_per_blob_gas(&self) -> Option<u128>

Max fee per blob gas for EIP-4844 transaction. Read more
§

fn priority_fee_or_price(&self) -> u128

Return the max priority fee per gas if the transaction is an dynamic fee transaction, and otherwise return the gas price. Read more
§

fn effective_gas_price(&self, base_fee: Option<u64>) -> u128

Returns the effective gas price for the given base fee. Read more
§

fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>

Returns the effective tip for this transaction. Read more
§

fn is_dynamic_fee(&self) -> bool

Returns true if the transaction supports dynamic fees.
§

fn kind(&self) -> TxKind

Returns the transaction kind.
§

fn is_create(&self) -> bool

Returns true if the transaction is a contract creation. We don’t provide a default implementation via kind as it copies the 21-byte [TxKind] for this simple check. A proper implementation shouldn’t allocate.
§

fn to(&self) -> Option<Address>

Get the transaction’s address of the contract that will be called, or the address that will receive the transfer. Read more
§

fn value(&self) -> Uint<256, 4>

Get value.
§

fn input(&self) -> &Bytes

Get data.
§

fn function_selector(&self) -> Option<&FixedBytes<4>>

Returns the first 4bytes of the calldata for a function call. Read more
§

fn access_list(&self) -> Option<&AccessList>

Returns the EIP-2930 access_list for the particular transaction type. Returns None for older transaction types.
§

fn blob_versioned_hashes(&self) -> Option<&[FixedBytes<32>]>

Blob versioned hashes for eip4844 transaction. For previous transaction types this is None.
§

fn blob_count(&self) -> Option<u64>

Returns the number of blobs of this transaction. Read more
§

fn blob_gas_used(&self) -> Option<u64>

Returns the total gas for all blobs in this transaction. Read more
§

fn authorization_list(&self) -> Option<&[SignedAuthorization]>

Returns the [SignedAuthorization] list of the transaction. Read more
§

fn authorization_count(&self) -> Option<u64>

Returns the number of blobs of [SignedAuthorization] in this transactions Read more
§

impl<T> TransactionGetter for Arc<T>
where T: TransactionGetter + ?Sized,

§

type Transaction = <T as TransactionGetter>::Transaction

§

fn tx(&self) -> &<Arc<T> as TransactionGetter>::Transaction

Source§

impl<T> TransactionPool for Arc<T>
where T: TransactionPool + ?Sized, Arc<T>: Clone + Debug + Send + Sync,

Source§

type Transaction = <T as TransactionPool>::Transaction

The transaction type of the pool
Source§

fn pool_size(&self) -> PoolSize

Returns stats about the pool and all sub-pools.
Source§

fn block_info(&self) -> BlockInfo

Returns the block the pool is currently tracking. Read more
Source§

fn add_external_transaction( &self, transaction: <Arc<T> as TransactionPool>::Transaction, ) -> impl Future<Output = Result<FixedBytes<32>, PoolError>> + Send

Imports an external transaction. Read more
Source§

fn add_external_transactions( &self, transactions: Vec<<Arc<T> as TransactionPool>::Transaction>, ) -> impl Future<Output = Vec<Result<FixedBytes<32>, PoolError>>> + Send

Imports all external transactions Read more
Source§

fn add_transaction_and_subscribe( &self, origin: TransactionOrigin, transaction: <Arc<T> as TransactionPool>::Transaction, ) -> impl Future<Output = Result<TransactionEvents, PoolError>> + Send

Adds an unvalidated transaction into the pool and subscribe to state changes. Read more
Source§

fn add_transaction( &self, origin: TransactionOrigin, transaction: <Arc<T> as TransactionPool>::Transaction, ) -> impl Future<Output = Result<FixedBytes<32>, PoolError>> + Send

Adds an unvalidated transaction into the pool. Read more
Source§

fn add_transactions( &self, origin: TransactionOrigin, transactions: Vec<<Arc<T> as TransactionPool>::Transaction>, ) -> impl Future<Output = Vec<Result<FixedBytes<32>, PoolError>>> + Send

Adds the given unvalidated transaction into the pool. Read more
Source§

fn transaction_event_listener( &self, tx_hash: FixedBytes<32>, ) -> Option<TransactionEvents>

Returns a new transaction change event stream for the given transaction. Read more
Source§

fn all_transactions_event_listener( &self, ) -> AllTransactionsEvents<<Arc<T> as TransactionPool>::Transaction>

Returns a new transaction change event stream for all transactions in the pool.
Source§

fn pending_transactions_listener(&self) -> Receiver<FixedBytes<32>>

Returns a new Stream that yields transactions hashes for new pending transactions inserted into the pool that are allowed to be propagated. Read more
Source§

fn pending_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<FixedBytes<32>>

Returns a new [Receiver] that yields transactions hashes for new pending transactions inserted into the pending pool depending on the given TransactionListenerKind argument.
Source§

fn new_transactions_listener( &self, ) -> Receiver<NewTransactionEvent<<Arc<T> as TransactionPool>::Transaction>>

Returns a new stream that yields new valid transactions added to the pool.
Source§

fn blob_transaction_sidecars_listener(&self) -> Receiver<NewBlobSidecar>

Returns a new [Receiver] that yields blob “sidecars” (blobs w/ assoc. kzg commitments/proofs) for eip-4844 transactions inserted into the pool
Source§

fn new_transactions_listener_for( &self, kind: TransactionListenerKind, ) -> Receiver<NewTransactionEvent<<Arc<T> as TransactionPool>::Transaction>>

Returns a new stream that yields new valid transactions added to the pool depending on the given TransactionListenerKind argument.
Source§

fn new_pending_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<<Arc<T> as TransactionPool>::Transaction>

Returns a new Stream that yields new transactions added to the pending sub-pool. Read more
Source§

fn new_basefee_pool_transactions_listener( &self, ) -> NewSubpoolTransactionStream<<Arc<T> as TransactionPool>::Transaction>

Returns a new Stream that yields new transactions added to the basefee sub-pool. Read more
Source§

fn new_queued_transactions_listener( &self, ) -> NewSubpoolTransactionStream<<Arc<T> as TransactionPool>::Transaction>

Returns a new Stream that yields new transactions added to the queued-pool. Read more
Source§

fn pooled_transaction_hashes(&self) -> Vec<FixedBytes<32>>

Returns the hashes of all transactions in the pool. Read more
Source§

fn pooled_transaction_hashes_max(&self, max: usize) -> Vec<FixedBytes<32>>

Returns only the first max hashes of transactions in the pool. Read more
Source§

fn pooled_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns the full transaction objects all transactions in the pool. Read more
Source§

fn pooled_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns only the first max transactions in the pool. Read more
Source§

fn get_pooled_transaction_elements( &self, tx_hashes: Vec<FixedBytes<32>>, limit: GetPooledTransactionLimit, ) -> Vec<<<Arc<T> as TransactionPool>::Transaction as PoolTransaction>::Pooled>

Returns converted [PooledTransaction] for the given transaction hashes. Read more
Source§

fn get_pooled_transaction_element( &self, tx_hash: FixedBytes<32>, ) -> Option<Recovered<<<Arc<T> as TransactionPool>::Transaction as PoolTransaction>::Pooled>>

Returns the pooled transaction variant for the given transaction hash. Read more
Source§

fn best_transactions( &self, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>>

Returns an iterator that yields transactions that are ready for block production. Read more
Source§

fn best_transactions_with_attributes( &self, best_transactions_attributes: BestTransactionsAttributes, ) -> Box<dyn BestTransactions<Item = Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>>

Returns an iterator that yields transactions that are ready for block production with the given base fee and optional blob fee attributes. Read more
Source§

fn pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that can be included in the next block. Read more
Source§

fn pending_transactions_max( &self, max: usize, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns first max transactions that can be included in the next block. See https://github.com/paradigmxyz/reth/issues/12767#issuecomment-2493223579 Read more
Source§

fn queued_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that can be included in future blocks. Read more
Source§

fn all_transactions( &self, ) -> AllPoolTransactions<<Arc<T> as TransactionPool>::Transaction>

Returns all transactions that are currently in the pool grouped by whether they are ready for inclusion in the next block or not. Read more
Source§

fn remove_transactions( &self, hashes: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Removes all transactions corresponding to the given hashes. Read more
Source§

fn remove_transactions_and_descendants( &self, hashes: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Removes all transactions corresponding to the given hashes. Read more
Source§

fn remove_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Removes all transactions from the given sender Read more
Source§

fn retain_unknown<A>(&self, announcement: &mut A)
where A: HandleMempoolData,

Retains only those hashes that are unknown to the pool. In other words, removes all transactions from the given set that are currently present in the pool. Returns hashes already known to the pool. Read more
Source§

fn contains(&self, tx_hash: &FixedBytes<32>) -> bool

Returns if the transaction for the given hash is already included in this pool.
Source§

fn get( &self, tx_hash: &FixedBytes<32>, ) -> Option<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns the transaction for the given hash.
Source§

fn get_all( &self, txs: Vec<FixedBytes<32>>, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions objects for the given hashes. Read more
Source§

fn on_propagated(&self, txs: PropagatedTransactions)

Notify the pool about transactions that are propagated to peers. Read more
Source§

fn get_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions sent by a given user
Source§

fn get_pending_transactions_with_predicate( &self, predicate: impl FnMut(&ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>) -> bool, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions filtered by predicate
Source§

fn get_pending_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions sent by a given user
Source§

fn get_queued_transactions_by_sender( &self, sender: Address, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all queued transactions sent by a given user
Source§

fn get_highest_transaction_by_sender( &self, sender: Address, ) -> Option<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns the highest transaction sent by a given user
Source§

fn get_highest_consecutive_transaction_by_sender( &self, sender: Address, on_chain_nonce: u64, ) -> Option<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns the transaction with the highest nonce that is executable given the on chain nonce. In other words the highest non nonce gapped transaction. Read more
Source§

fn get_transaction_by_sender_and_nonce( &self, sender: Address, nonce: u64, ) -> Option<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns a transaction sent by a given user and a nonce
Source§

fn get_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that where submitted with the given TransactionOrigin
Source§

fn get_pending_transactions_by_origin( &self, origin: TransactionOrigin, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions filtered by TransactionOrigin
Source§

fn get_local_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::Local
Source§

fn get_private_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::Private
Source§

fn get_external_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all transactions that where submitted as TransactionOrigin::External
Source§

fn get_local_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::Local
Source§

fn get_private_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::Private
Source§

fn get_external_pending_transactions( &self, ) -> Vec<Arc<ValidPoolTransaction<<Arc<T> as TransactionPool>::Transaction>>>

Returns all pending transactions that where submitted as TransactionOrigin::External
Source§

fn unique_senders(&self) -> HashSet<Address>

Returns a set of all senders of transactions in the pool
Source§

fn get_blob( &self, tx_hash: FixedBytes<32>, ) -> Result<Option<Arc<BlobTransactionSidecar>>, BlobStoreError>

Returns the [BlobTransactionSidecar] for the given transaction hash if it exists in the blob store.
Source§

fn get_all_blobs( &self, tx_hashes: Vec<FixedBytes<32>>, ) -> Result<Vec<(FixedBytes<32>, Arc<BlobTransactionSidecar>)>, BlobStoreError>

Returns all [BlobTransactionSidecar] for the given transaction hashes if they exists in the blob store. Read more
Source§

fn get_all_blobs_exact( &self, tx_hashes: Vec<FixedBytes<32>>, ) -> Result<Vec<Arc<BlobTransactionSidecar>>, BlobStoreError>

Returns the exact [BlobTransactionSidecar] for the given transaction hashes in the order they were requested. Read more
Source§

fn get_blobs_for_versioned_hashes( &self, versioned_hashes: &[FixedBytes<32>], ) -> Result<Vec<Option<BlobAndProofV1>>, BlobStoreError>

Return the [BlobTransactionSidecar]s for a list of blob versioned hashes.
Source§

impl<T> TransactionPoolExt for Arc<T>

Source§

fn set_block_info(&self, info: BlockInfo)

Sets the current block info for the pool.
Source§

fn on_canonical_state_change<B>(&self, update: CanonicalStateUpdate<'_, B>)
where B: Block,

Event listener for when the pool needs to be updated. Read more
Source§

fn update_accounts(&self, accounts: Vec<ChangedAccount>)

Updates the accounts in the pool
Source§

fn delete_blob(&self, tx: FixedBytes<32>)

Deletes the blob sidecar for the given transaction from the blob store
Source§

fn delete_blobs(&self, txs: Vec<FixedBytes<32>>)

Deletes multiple blob sidecars from the blob store
Source§

fn cleanup_blobs(&self)

Maintenance function to cleanup blobs that are no longer needed.
§

impl<T> TransactionsProvider for Arc<T>
where T: TransactionsProvider + ?Sized, Arc<T>: BlockNumReader + Send + Sync,

§

type Transaction = <T as TransactionsProvider>::Transaction

The transaction type this provider reads.
§

fn transaction_id( &self, tx_hash: FixedBytes<32>, ) -> Result<Option<u64>, ProviderError>

Get internal transaction identifier by transaction hash. Read more
§

fn transaction_by_id( &self, id: u64, ) -> Result<Option<<Arc<T> as TransactionsProvider>::Transaction>, ProviderError>

Get transaction by id, computes hash every time so more expensive.
§

fn transaction_by_id_unhashed( &self, id: u64, ) -> Result<Option<<Arc<T> as TransactionsProvider>::Transaction>, ProviderError>

Get transaction by id without computing the hash.
§

fn transaction_by_hash( &self, hash: FixedBytes<32>, ) -> Result<Option<<Arc<T> as TransactionsProvider>::Transaction>, ProviderError>

Get transaction by transaction hash.
§

fn transaction_by_hash_with_meta( &self, hash: FixedBytes<32>, ) -> Result<Option<(<Arc<T> as TransactionsProvider>::Transaction, TransactionMeta)>, ProviderError>

Get transaction by transaction hash and additional metadata of the block the transaction was mined in
§

fn transaction_block(&self, id: u64) -> Result<Option<u64>, ProviderError>

Get transaction block number
§

fn transactions_by_block( &self, block: HashOrNumber, ) -> Result<Option<Vec<<Arc<T> as TransactionsProvider>::Transaction>>, ProviderError>

Get transactions by block id.
§

fn transactions_by_block_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<Vec<<Arc<T> as TransactionsProvider>::Transaction>>, ProviderError>

Get transactions by block range.
§

fn transactions_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<<Arc<T> as TransactionsProvider>::Transaction>, ProviderError>

Get transactions by tx range.
§

fn senders_by_tx_range( &self, range: impl RangeBounds<u64>, ) -> Result<Vec<Address>, ProviderError>

Get Senders from a tx range.
§

fn transaction_sender(&self, id: u64) -> Result<Option<Address>, ProviderError>

Get transaction sender. Read more
§

impl<T> TransactionsProviderExt for Arc<T>
where T: TransactionsProviderExt + ?Sized, Arc<T>: BlockReader,

§

fn transaction_range_by_block_range( &self, block_range: RangeInclusive<u64>, ) -> Result<RangeInclusive<u64>, ProviderError>

Get transactions range by block range.
§

fn transaction_hashes_by_range( &self, tx_range: Range<u64>, ) -> Result<Vec<(FixedBytes<32>, u64)>, ProviderError>

Get transaction hashes from a transaction range.
§

impl<T> TreeHash for Arc<T>
where T: TreeHash,

§

fn tree_hash_type() -> TreeHashType

§

fn tree_hash_packed_encoding(&self) -> SmallVec<[u8; 32]>

§

fn tree_hash_packing_factor() -> usize

§

fn tree_hash_root(&self) -> FixedBytes<32>

§

impl<T> TrieWriter for Arc<T>
where T: TrieWriter + ?Sized, Arc<T>: Send + Sync,

§

fn write_trie_updates( &self, trie_updates: &TrieUpdates, ) -> Result<usize, ProviderError>

Writes trie updates to the database. Read more
§

impl<Db> TryDatabaseCommit for Arc<Db>
where Db: DatabaseCommit + Send + Sync,

§

type Error = ArcUpgradeError

Error type for when [TryDatabaseCommit::try_commit] fails.
§

fn try_commit( &mut self, changes: HashMap<Address, Account, RandomState>, ) -> Result<(), <Arc<Db> as TryDatabaseCommit>::Error>

Attempt to commit changes to the database.
§

impl<T> TxReceipt for Arc<T>
where T: TxReceipt + ?Sized, Arc<T>: Clone + Debug + PartialEq + Eq + Send + Sync,

§

type Log = <T as TxReceipt>::Log

The associated log type.
§

fn status_or_post_state(&self) -> Eip658Value

Returns the status or post state of the transaction. Read more
§

fn status(&self) -> bool

Returns true if the transaction was successful OR if the transaction is pre-EIP-658. Results for transactions before EIP-658 are not reliable. Read more
§

fn bloom(&self) -> Bloom

Returns the bloom filter for the logs in the receipt. This operation may be expensive.
§

fn bloom_cheap(&self) -> Option<Bloom>

Returns the bloom filter for the logs in the receipt, if it is cheap to compute.
§

fn cumulative_gas_used(&self) -> u64

Returns the cumulative gas used in the block after this transaction was executed.
§

fn logs(&self) -> &[<Arc<T> as TxReceipt>::Log]

Returns the logs emitted by this transaction.
§

fn with_bloom_ref(&self) -> ReceiptWithBloom<&Self>

Returns [ReceiptWithBloom] with the computed bloom filter [Self::bloom] and a reference to the receipt.
§

fn into_with_bloom(self) -> ReceiptWithBloom<Self>

Consumes the type and converts it into [ReceiptWithBloom] with the computed bloom filter [Self::bloom] and the receipt.
§

impl<Signature, T> TxSigner<Signature> for Arc<T>
where T: TxSigner<Signature> + ?Sized,

§

fn address(&self) -> Address

Get the address of the signer.
§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut (dyn SignableTransaction<Signature> + 'static), ) -> Pin<Box<dyn Future<Output = Result<Signature, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Asynchronously sign an unsigned transaction.
§

impl<Signature, T> TxSignerSync<Signature> for Arc<T>
where T: TxSignerSync<Signature> + ?Sized,

§

fn address(&self) -> Address

Get the address of the signer.
§

fn sign_transaction_sync( &self, tx: &mut (dyn SignableTransaction<Signature> + 'static), ) -> Result<Signature, Error>

Synchronously sign an unsigned transaction.
§

impl<T> Valid for Arc<T>
where T: Valid + Sync + Send,

§

fn check(&self) -> Result<(), SerializationError>

§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Arc<T>> + Send, ) -> Result<(), SerializationError>
where Arc<T>: 'a,

§

impl<T> ValueParserFactory for Arc<T>
where T: ValueParserFactory + Send + Sync + Clone, <T as ValueParserFactory>::Parser: TypedValueParser<Value = T>,

§

type Parser = MapValueParser<<T as ValueParserFactory>::Parser, fn(T) -> Arc<T>>

Generated parser, usually [ValueParser]. Read more
§

fn value_parser() -> <Arc<T> as ValueParserFactory>::Parser

Create the specified [Self::Parser]
§

impl<T> WithdrawalsProvider for Arc<T>
where T: WithdrawalsProvider + ?Sized, Arc<T>: Send + Sync,

§

fn withdrawals_by_block( &self, id: HashOrNumber, timestamp: u64, ) -> Result<Option<Withdrawals>, ProviderError>

Get withdrawals by block id.
§

impl<T> WrapperTypeDecode for Arc<T>

§

type Wrapped = T

A wrapped type.
§

impl<'a, T> Writeable for Arc<T>
where T: Writeable + ?Sized,

§

fn write_to<W>(&self, sink: &mut W) -> Result<(), Error>
where W: Write + ?Sized,

Writes a string to the given sink. Errors from the sink are bubbled up. The default implementation delegates to write_to_parts, and discards any Part annotations.
§

fn write_to_parts<W>(&self, sink: &mut W) -> Result<(), Error>
where W: PartsWrite + ?Sized,

Write bytes and Part annotations to the given sink. Errors from the sink are bubbled up. The default implementation delegates to write_to, and doesn’t produce any Part annotations.
§

fn writeable_length_hint(&self) -> LengthHint

Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more
§

fn write_to_string(&self) -> Cow<'_, str>

Creates a new String with the data from this Writeable. Like ToString, but smaller and faster. Read more
§

fn writeable_cmp_bytes(&self, other: &[u8]) -> Ordering

Compares the contents of this Writeable to the given bytes without allocating a String to hold the Writeable contents. Read more
§

impl<T> CartablePointerLike for Arc<T>

§

impl<T> CloneStableDeref for Arc<T>
where T: ?Sized,

§

impl<T> CloneableCart for Arc<T>
where T: ?Sized,

§

impl<T> CloneableCartablePointerLike for Arc<T>

Source§

impl<T, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where T: Unsize<U> + ?Sized, A: Allocator, U: ?Sized,

§

impl<T> DecodeWithMemTracking for Arc<T>
where T: DecodeWithMemTracking,

Source§

impl<T, A> DerefPure for Arc<T, A>
where A: Allocator, T: ?Sized,

Source§

impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>
where T: Unsize<U> + ?Sized, U: ?Sized,

§

impl<T> EncodeLike<Arc<T>> for T
where T: Encode,

§

impl<T> EncodeLike<T> for Arc<T>
where T: Encode,

§

impl<T> EncodeLike for Arc<T>
where T: Encode + ?Sized,

1.0.0 · Source§

impl<T, A> Eq for Arc<T, A>
where T: Eq + ?Sized, A: Allocator,

Source§

impl<T, A> PinCoerceUnsized for Arc<T, A>
where A: Allocator, T: ?Sized,

§

impl<T> Receipt for Arc<T>
where Arc<T>: Send + Sync + Unpin + Clone + Debug + TxReceipt<Log = Log> + RlpEncodableReceipt + RlpDecodableReceipt + Eip2718EncodableReceipt + Typed2718 + MaybeSerde + InMemorySize + MaybeSerdeBincodeCompat, T: Receipt + ?Sized,

1.0.0 · Source§

impl<T, A> Send for Arc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Send,

§

impl<T> StableDeref for Arc<T>
where T: ?Sized,

1.0.0 · Source§

impl<T, A> Sync for Arc<T, A>
where T: Sync + Send + ?Sized, A: Allocator + Sync,

1.33.0 · Source§

impl<T, A> Unpin for Arc<T, A>
where A: Allocator, T: ?Sized,

1.9.0 · Source§

impl<T, A> UnwindSafe for Arc<T, A>

Source§

impl<T, A> UseCloned for Arc<T, A>
where A: Allocator + Clone, T: ?Sized,

§

impl<T> WrapperTypeEncode for Arc<T>
where T: ?Sized,