blueprint_test_utils::eigenlayer_test_env

Struct Arc

1.0.0 · Source
pub struct Arc<T, A = Global>
where A: Allocator, T: ?Sized,
{ /* private fields */ }
Expand description

A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.

The type Arc<T> provides shared ownership of a value of type T, allocated in the heap. Invoking clone on Arc produces a new Arc instance, which points to the same allocation on the heap as the source Arc, while increasing a reference count. When the last Arc pointer to a given allocation is destroyed, the value stored in that allocation (often referred to as “inner value”) is also dropped.

Shared references in Rust disallow mutation by default, and Arc is no exception: you cannot generally obtain a mutable reference to something inside an Arc. If you need to mutate through an Arc, use Mutex, RwLock, or one of the Atomic types.

Note: This type is only available on platforms that support atomic loads and stores of pointers, which includes all platforms that support the std crate but not all those which only support alloc. This may be detected at compile time using #[cfg(target_has_atomic = "ptr")].

§Thread Safety

Unlike Rc<T>, Arc<T> uses atomic operations for its reference counting. This means that it is thread-safe. The disadvantage is that atomic operations are more expensive than ordinary memory accesses. If you are not sharing reference-counted allocations between threads, consider using Rc<T> for lower overhead. Rc<T> is a safe default, because the compiler will catch any attempt to send an Rc<T> between threads. However, a library might choose Arc<T> in order to give library consumers more flexibility.

Arc<T> will implement Send and Sync as long as the T implements Send and Sync. Why can’t you put a non-thread-safe type T in an Arc<T> to make it thread-safe? This may be a bit counter-intuitive at first: after all, isn’t the point of Arc<T> thread safety? The key is this: Arc<T> makes it thread safe to have multiple ownership of the same data, but it doesn’t add thread safety to its data. Consider Arc<RefCell<T>>. RefCell<T> isn’t Sync, and if Arc<T> was always Send, Arc<RefCell<T>> would be as well. But then we’d have a problem: RefCell<T> is not thread safe; it keeps track of the borrowing count using non-atomic operations.

In the end, this means that you may need to pair Arc<T> with some sort of std::sync type, usually Mutex<T>.

§Breaking cycles with Weak

The downgrade method can be used to create a non-owning Weak pointer. A Weak pointer can be upgraded to an Arc, but this will return None if the value stored in the allocation has already been dropped. In other words, Weak pointers do not keep the value inside the allocation alive; however, they do keep the allocation (the backing store for the value) alive.

A cycle between Arc pointers will never be deallocated. For this reason, Weak is used to break cycles. For example, a tree could have strong Arc pointers from parent nodes to children, and Weak pointers from children back to their parents.

§Cloning references

Creating a new reference from an existing reference-counted pointer is done using the Clone trait implemented for Arc<T> and Weak<T>.

use std::sync::Arc;
let foo = Arc::new(vec![1.0, 2.0, 3.0]);
// The two syntaxes below are equivalent.
let a = foo.clone();
let b = Arc::clone(&foo);
// a, b, and foo are all Arcs that point to the same memory location

§Deref behavior

Arc<T> automatically dereferences to T (via the Deref trait), so you can call T’s methods on a value of type Arc<T>. To avoid name clashes with T’s methods, the methods of Arc<T> itself are associated functions, called using fully qualified syntax:

use std::sync::Arc;

let my_arc = Arc::new(());
let my_weak = Arc::downgrade(&my_arc);

Arc<T>’s implementations of traits like Clone may also be called using fully qualified syntax. Some people prefer to use fully qualified syntax, while others prefer using method-call syntax.

use std::sync::Arc;

let arc = Arc::new(());
// Method-call syntax
let arc2 = arc.clone();
// Fully qualified syntax
let arc3 = Arc::clone(&arc);

Weak<T> does not auto-dereference to T, because the inner value may have already been dropped.

§Examples

Sharing some immutable data between threads:

use std::sync::Arc;
use std::thread;

let five = Arc::new(5);

for _ in 0..10 {
    let five = Arc::clone(&five);

    thread::spawn(move || {
        println!("{five:?}");
    });
}

Sharing a mutable AtomicUsize:

use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;

let val = Arc::new(AtomicUsize::new(5));

for _ in 0..10 {
    let val = Arc::clone(&val);

    thread::spawn(move || {
        let v = val.fetch_add(1, Ordering::Relaxed);
        println!("{v:?}");
    });
}

See the rc documentation for more examples of reference counting in general.

Implementations§

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)

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)

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)

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)

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)

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,

Source

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

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

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)

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)

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)

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)

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)

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)

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)

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)

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();
Source§

impl<T> Arc<[T]>

1.82.0 · Source

pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]>

Constructs a new atomically reference-counted slice with uninitialized contents.

§Examples
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut values = Arc::<[u32]>::new_uninit_slice(3);

// Deferred initialization:
let data = Arc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);

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

assert_eq!(*values, [1, 2, 3])
Source

pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]>

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

Constructs a new atomically reference-counted slice 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 values = Arc::<[u32]>::new_zeroed_slice(3);
let values = unsafe { values.assume_init() };

assert_eq!(*values, [0, 0, 0])
Source§

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

Source

pub fn new_uninit_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A>

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

Constructs a new atomically reference-counted slice 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 values = Arc::<[u32], _>::new_uninit_slice_in(3, System);

let values = unsafe {
    // Deferred initialization:
    Arc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
    Arc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
    Arc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);

    values.assume_init()
};

assert_eq!(*values, [1, 2, 3])
Source

pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A>

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

Constructs a new atomically reference-counted slice 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 values = Arc::<[u32], _>::new_zeroed_slice_in(3, System);
let values = unsafe { values.assume_init() };

assert_eq!(*values, [0, 0, 0])
Source§

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

1.82.0 · Source

pub unsafe fn assume_init(self) -> Arc<T, A>

Converts to Arc<T>.

§Safety

As with MaybeUninit::assume_init, it is up to the caller to guarantee that the inner value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.

§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§

impl<T, A> Arc<[MaybeUninit<T>], A>
where A: Allocator,

1.82.0 · Source

pub unsafe fn assume_init(self) -> Arc<[T], A>

Converts to Arc<[T]>.

§Safety

As with MaybeUninit::assume_init, it is up to the caller to guarantee that the inner value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.

§Examples
#![feature(get_mut_unchecked)]

use std::sync::Arc;

let mut values = Arc::<[u32]>::new_uninit_slice(3);

// Deferred initialization:
let data = Arc::get_mut(&mut values).unwrap();
data[0].write(1);
data[1].write(2);
data[2].write(3);

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

assert_eq!(*values, [1, 2, 3])
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 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 the associated Arc instance must be valid (i.e. the strong count must be at least 1) for the duration of this method.

§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 the associated Arc instance must be valid (i.e. the strong count must be at least 1) when invoking this method. 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, 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)

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)

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)

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)

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 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)

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, 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)

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().into();
    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<A> Arc<dyn Any + Send + Sync, A>
where A: Allocator,

1.29.0 · Source

pub fn downcast<T>(self) -> Result<Arc<T, A>, Arc<dyn Any + Send + Sync, A>>
where T: Any + Send + Sync,

Attempts to downcast the Arc<dyn Any + Send + Sync> to a concrete type.

§Examples
use std::any::Any;
use std::sync::Arc;

fn print_if_string(value: Arc<dyn Any + Send + Sync>) {
    if let Ok(string) = value.downcast::<String>() {
        println!("String ({}): {}", string.len(), string);
    }
}

let my_string = "Hello World".to_string();
print_if_string(Arc::new(my_string));
print_if_string(Arc::new(0i8));
Source

pub unsafe fn downcast_unchecked<T>(self) -> Arc<T, A>
where T: Any + Send + Sync,

🔬This is a nightly-only experimental API. (downcast_unchecked)

Downcasts the Arc<dyn Any + Send + Sync> to a concrete type.

For a safe alternative see downcast.

§Examples
#![feature(downcast_unchecked)]

use std::any::Any;
use std::sync::Arc;

let x: Arc<dyn Any + Send + Sync> = Arc::new(1_usize);

unsafe {
    assert_eq!(*x.downcast_unchecked::<usize>(), 1);
}
§Safety

The contained value must be of type T. Calling this method with the incorrect type is undefined behavior.

Trait Implementations§

Source§

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

Source§

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

Loads an AnyPayload according to the key and request.
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.
Source§

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

Source§

fn sleep(&self, duration: Duration) -> Sleep

Returns a future that sleeps for the given duration of time.
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
Source§

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

Source§

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

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

fn bound_key(&self) -> DataKey

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

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

Source§

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> CanonicalDeserialize for Arc<T>

Source§

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.
Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> CanonicalSerialize for Arc<T>

Source§

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

The general serialize method that takes in customization flags.
Source§

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

Source§

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

Source§

fn compressed_size(&self) -> usize

Source§

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

Source§

fn uncompressed_size(&self) -> usize

Source§

impl<Event, T> Client<Event> for Arc<T>
where T: Client<Event> + ?Sized, Arc<T>: Clone + Send + Sync,

Source§

fn next_event<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Event>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Fetch the next event from the client.
Source§

fn latest_event<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<Event>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Fetch the latest event from the client. Read more
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
Source§

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

Source§

fn increment(&self, value: u64)

Increments the counter by the given amount.
Source§

fn absolute(&self, value: u64)

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

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

Source§

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

Query the provider for data, returning the result. Read more
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
Source§

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

Source§

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

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

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

Source§

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

1.80.0 · Source§

impl<T> Default for Arc<[T]>

Source§

fn default() -> Arc<[T]>

Creates an empty [T] inside an Arc

This may or may not share an allocation with other Arcs.

1.80.0 · Source§

impl Default for Arc<CStr>

Source§

fn default() -> Arc<CStr>

Creates an empty CStr inside an Arc

This may or may not share an allocation with other Arcs.

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.80.0 · Source§

impl Default for Arc<str>

Source§

fn default() -> Arc<str>

Creates an empty str inside an Arc

This may or may not share an allocation with other Arcs.

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
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!"
Source§

impl<M, P> DynamicDataProvider<M> for Arc<P>

Source§

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

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

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

Source§

fn length(&self) -> usize

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

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

Encodes the type into the out buffer.
Source§

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

Source§

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

Source§

fn length(&self) -> usize

Source§

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

Source§

fn encode_as_fields_to<R>( &self, fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>, types: &R, out: &mut Vec<u8>, ) -> Result<(), Error>
where R: TypeResolver,

Given some fields describing the shape of a type, attempt to encode to that shape.
Source§

fn encode_as_fields<R>( &self, fields: &mut dyn FieldIter<'_, <R as TypeResolver>::TypeId, Item = Field<'_, <R as TypeResolver>::TypeId>>, types: &R, ) -> Result<Vec<u8>, Error>
where R: TypeResolver,

This is a helper function which internally calls EncodeAsFields::encode_as_fields_to. Prefer to implement that instead.
Source§

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

Source§

fn encode_as_type_to<R>( &self, type_id: <R as TypeResolver>::TypeId, types: &R, out: &mut Vec<u8>, ) -> Result<(), Error>
where R: TypeResolver,

Given some type_id, types, a context and some output target for the SCALE encoded bytes, attempt to SCALE encode the current value into the type given by type_id.
Source§

fn encode_as_type<R>( &self, type_id: <R as TypeResolver>::TypeId, types: &R, ) -> Result<Vec<u8>, Error>
where R: TypeResolver,

This is a helper function which internally calls EncodeAsType::encode_as_type_to. Prefer to implement that instead.
Source§

impl<T> EncodeLabelKey for Arc<T>
where &'a T: for<'a> EncodeLabelKey,

Source§

fn encode(&self, encoder: &mut LabelKeyEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
Source§

impl<T> EncodeLabelValue for Arc<T>
where &'a T: for<'a> EncodeLabelValue,

Source§

fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result<(), Error>

Encode oneself into the given encoder.
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)
Provides type-based access to context intended for error reports. Read more
Source§

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

Source§

fn exists(&self, id: &oid) -> bool

Returns true if the object exists in the database.
Source§

impl<S> Filter<S> for Arc<dyn Filter<S> + Send + Sync>

Source§

fn enabled(&self, meta: &Metadata<'_>, cx: &Context<'_, S>) -> bool

Returns true if this layer is interested in a span or event with the given Metadata in the current Context, similarly to Subscriber::enabled. Read more
Source§

fn callsite_enabled(&self, meta: &'static Metadata<'static>) -> Interest

Returns an Interest indicating whether this layer will always, sometimes, or never be interested in the given Metadata. Read more
Source§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns an optional hint of the highest verbosity level that this Filter will enable. Read more
Source§

fn event_enabled(&self, event: &Event<'_>, cx: &Context<'_, S>) -> bool

Called before the filtered [Layer]'s [on_event], to determine if on_event` should be called. Read more
Source§

fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a new span was constructed with the given Attributes and Id. Read more
Source§

fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>)

Notifies this filter that a span with the given Id recorded the given values. Read more
Source§

fn on_enter(&self, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID was entered. Read more
Source§

fn on_exit(&self, id: &Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID was exited. Read more
Source§

fn on_close(&self, id: Id, ctx: Context<'_, S>)

Notifies this filter that a span with the given ID has been closed. Read more
Source§

impl<S> Filter<S> for Arc<dyn Filter<S> + Send + Sync>

Source§

fn enabled(&self, meta: &Metadata<'_>, cx: &Context<'_, S>) -> bool

Returns true if this layer is interested in a span or event with the given Metadata in the current Context, similarly to Subscriber::enabled. Read more
Source§

fn callsite_enabled(&self, meta: &'static Metadata<'static>) -> Interest

Returns an Interest indicating whether this layer will always, sometimes, or never be interested in the given Metadata. Read more
Source§

fn max_level_hint(&self) -> Option<LevelFilter>

Returns an optional hint of the highest verbosity level that this Filter will enable. Read more
Source§

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

Source§

fn try_find<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<Option<Data<'a>>, Box<dyn Error + Send + Sync>>

Find an object matching id in the database while placing its raw, possibly encoded data into buffer. Read more
1.21.0 · Source§

impl<T> From<&[T]> for Arc<[T]>
where T: Clone,

Source§

fn from(v: &[T]) -> Arc<[T]>

Allocates a reference-counted slice and fills it by cloning v’s items.

§Example
let original: &[i32] = &[1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
1.24.0 · Source§

impl From<&CStr> for Arc<CStr>

Source§

fn from(s: &CStr) -> Arc<CStr>

Converts a &CStr into a Arc<CStr>, by copying the contents into a newly allocated Arc.

1.24.0 · Source§

impl From<&OsStr> for Arc<OsStr>

Source§

fn from(s: &OsStr) -> Arc<OsStr>

Copies the string into a newly allocated Arc<OsStr>.

1.24.0 · Source§

impl From<&Path> for Arc<Path>

Source§

fn from(s: &Path) -> Arc<Path>

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

Source§

impl From<&Utf8Path> for Arc<Path>

Source§

fn from(path: &Utf8Path) -> Arc<Path>

Converts to this type from the input type.
Source§

impl From<&Utf8Path> for Arc<Utf8Path>

Source§

fn from(path: &Utf8Path) -> Arc<Utf8Path>

Converts to this type from the input type.
1.84.0 · Source§

impl<T> From<&mut [T]> for Arc<[T]>
where T: Clone,

Source§

fn from(v: &mut [T]) -> Arc<[T]>

Allocates a reference-counted slice and fills it by cloning v’s items.

§Example
let mut original = [1, 2, 3];
let original: &mut [i32] = &mut original;
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
1.84.0 · Source§

impl From<&mut CStr> for Arc<CStr>

Source§

fn from(s: &mut CStr) -> Arc<CStr>

Converts a &mut CStr into a Arc<CStr>, by copying the contents into a newly allocated Arc.

1.84.0 · Source§

impl From<&mut OsStr> for Arc<OsStr>

Source§

fn from(s: &mut OsStr) -> Arc<OsStr>

Copies the string into a newly allocated Arc<OsStr>.

1.84.0 · Source§

impl From<&mut Path> for Arc<Path>

Source§

fn from(s: &mut Path) -> Arc<Path>

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

1.84.0 · Source§

impl From<&mut str> for Arc<str>

Source§

fn from(v: &mut str) -> Arc<str>

Allocates a reference-counted str and copies v into it.

§Example
let mut original = String::from("eggplant");
let original: &mut str = &mut original;
let shared: Arc<str> = Arc::from(original);
assert_eq!("eggplant", &shared[..]);
1.21.0 · Source§

impl From<&str> for Arc<str>

Source§

fn from(v: &str) -> Arc<str>

Allocates a reference-counted str and copies v into it.

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

impl<T, const N: usize> From<[T; N]> for Arc<[T]>

Source§

fn from(v: [T; N]) -> Arc<[T]>

Converts a [T; N] into an Arc<[T]>.

The conversion moves the array into a newly allocated Arc.

§Example
let original: [i32; 3] = [1, 2, 3];
let shared: Arc<[i32]> = Arc::from(original);
assert_eq!(&[1, 2, 3], &shared[..]);
1.51.0 · Source§

impl<W> From<Arc<W>> for Waker
where W: Wake + Send + Sync + 'static,

Source§

fn from(waker: Arc<W>) -> Waker

Use a Wake-able type as a Waker.

No heap allocations or atomic operations are used for this conversion.

1.62.0 · Source§

impl From<Arc<str>> for Arc<[u8]>

Source§

fn from(rc: Arc<str>) -> Arc<[u8]>

Converts an atomically reference-counted string slice into a byte slice.

§Example
let string: Arc<str> = Arc::from("eggplant");
let bytes: Arc<[u8]> = Arc::from(string);
assert_eq!("eggplant".as_bytes(), bytes.as_ref());
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.24.0 · Source§

impl From<CString> for Arc<CStr>

Source§

fn from(s: CString) -> Arc<CStr>

Converts a CString into an Arc<CStr> by moving the CString data into a new Arc buffer.

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.24.0 · Source§

impl From<OsString> for Arc<OsStr>

Source§

fn from(s: OsString) -> Arc<OsStr>

Converts an OsString into an Arc<OsStr> by moving the OsString data into a new Arc buffer.

1.24.0 · Source§

impl From<PathBuf> for Arc<Path>

Source§

fn from(s: PathBuf) -> Arc<Path>

Converts a PathBuf into an Arc<Path> by moving the PathBuf data into a new Arc buffer.

1.21.0 · Source§

impl From<String> for Arc<str>

Source§

fn from(v: String) -> Arc<str>

Allocates a reference-counted str and copies v into it.

§Example
let unique: String = "eggplant".to_owned();
let shared: Arc<str> = Arc::from(unique);
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);
Source§

impl From<Utf8PathBuf> for Arc<Path>

Source§

fn from(path: Utf8PathBuf) -> Arc<Path>

Converts to this type from the input type.
Source§

impl From<Utf8PathBuf> for Arc<Utf8Path>

Source§

fn from(path: Utf8PathBuf) -> Arc<Utf8Path>

Converts to this type from the input type.
1.21.0 · Source§

impl<T, A> From<Vec<T, A>> for Arc<[T], A>
where A: Allocator + Clone,

Source§

fn from(v: Vec<T, A>) -> Arc<[T], A>

Allocates a reference-counted slice and moves v’s items into it.

§Example
let unique: Vec<i32> = vec![1, 2, 3];
let shared: Arc<[i32]> = Arc::from(unique);
assert_eq!(&[1, 2, 3], &shared[..]);
Source§

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

Source§

type Error = <T as FromHex>::Error

The associated error which can be returned from parsing.
Source§

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
1.37.0 · Source§

impl<T> FromIterator<T> for Arc<[T]>

Source§

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

Takes each element in the Iterator and collects it into an Arc<[T]>.

§Performance characteristics
§The general case

In the general case, collecting into Arc<[T]> is done by first collecting into a Vec<T>. That is, when writing the following:

let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0).collect();

this behaves as if we wrote:

let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0)
    .collect::<Vec<_>>() // The first set of allocations happens here.
    .into(); // A second allocation for `Arc<[T]>` happens here.

This will allocate as many times as needed for constructing the Vec<T> and then it will allocate once for turning the Vec<T> into the Arc<[T]>.

§Iterators of known length

When your Iterator implements TrustedLen and is of an exact size, a single allocation will be made for the Arc<[T]>. For example:

let evens: Arc<[u8]> = (0..10).collect(); // Just a single allocation happens here.
Source§

impl<T> FromParallelIterator<T> for Arc<[T]>
where T: Send,

Collects items from a parallel iterator into an atomically-reference-counted slice.

Source§

fn from_par_iter<I>(par_iter: I) -> Arc<[T]>
where I: IntoParallelIterator<Item = T>,

Creates an instance of the collection from the parallel iterator par_iter. Read more
Source§

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

Source§

fn fetch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U256, GasOracleError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Makes an asynchronous HTTP query to the underlying GasOracle to fetch the current gas price estimate. Read more
Source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), GasOracleError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Makes an asynchronous HTTP query to the underlying GasOracle to fetch the current max gas fee and priority gas fee estimates. Read more
Source§

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

Source§

fn increment(&self, value: f64)

Increments the gauge by the given amount.
Source§

fn decrement(&self, value: f64)

Decrements the gauge by the given amount.
Source§

fn set(&self, value: f64)

Sets the gauge to the given amount.
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
Source§

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

Source§

fn try_header( &self, id: &oid, ) -> Result<Option<Header>, Box<dyn Error + Send + Sync>>

Find the header of the object matching id in the database. Read more
Source§

impl HeapStr for Arc<str>

Source§

fn from_str(other: &str) -> Arc<str>

Source§

fn from_string(other: String) -> Arc<str>

Source§

fn from_boxed_str(other: Box<str>) -> Arc<str>

Source§

fn as_str(&self) -> &str

Source§

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

Source§

fn record(&self, value: f64)

Records a value into the histogram.
Source§

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

Records a value into the histogram multiple times.
Source§

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

Source§

type AnyVisitor<R: TypeResolver> = BasicVisitor<Arc<T>, R>

The visitor type used to decode SCALE encoded bytes to Self.
Source§

fn into_visitor<R>() -> <Arc<T> as IntoVisitor>::AnyVisitor<R>
where R: TypeResolver,

A means of obtaining this visitor.
Source§

impl<U> JsonRpcClient for Arc<U>
where U: JsonRpcClient + ?Sized, Arc<U>: Debug + Send + Sync,

Source§

type Error = <U as JsonRpcClient>::Error

A JSON-RPC Error
Source§

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T, ) -> Pin<Box<dyn Future<Output = Result<R, <Arc<U> as JsonRpcClient>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: Debug + Serialize + Send + Sync + 'async_trait, R: DeserializeOwned + Send + 'async_trait, Arc<U>: 'async_trait,

Sends a request with the provided JSON-RPC and parameters serialized as JSON
Source§

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

Source§

fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>

Returns all the sr25519 public keys for the given key type.
Source§

fn sr25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str>, ) -> Result<Public, Error>

Generate a new sr25519 key pair for the given key type and an optional seed. Read more
Source§

fn sr25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8], ) -> Result<Option<Signature>, Error>

Generate an sr25519 signature for a given message. Read more
Source§

fn sr25519_vrf_sign( &self, key_type: KeyTypeId, public: &Public, data: &VrfSignData, ) -> Result<Option<VrfSignature>, Error>

Generate an sr25519 VRF signature for the given data. Read more
Source§

fn sr25519_vrf_pre_output( &self, key_type: KeyTypeId, public: &Public, input: &VrfTranscript, ) -> Result<Option<VrfPreOutput>, Error>

Generate an sr25519 VRF pre-output for a given input data. Read more
Source§

fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>

Returns all ed25519 public keys for the given key type.
Source§

fn ed25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str>, ) -> Result<Public, Error>

Generate a new ed25519 key pair for the given key type and an optional seed. Read more
Source§

fn ed25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8], ) -> Result<Option<Signature>, Error>

Generate an ed25519 signature for a given message. Read more
Source§

fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>

Returns all ecdsa public keys for the given key type.
Source§

fn ecdsa_generate_new( &self, key_type: KeyTypeId, seed: Option<&str>, ) -> Result<Public, Error>

Generate a new ecdsa key pair for the given key type and an optional seed. Read more
Source§

fn ecdsa_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8], ) -> Result<Option<Signature>, Error>

Generate an ecdsa signature for a given message. Read more
Source§

fn ecdsa_sign_prehashed( &self, key_type: KeyTypeId, public: &Public, msg: &[u8; 32], ) -> Result<Option<Signature>, Error>

Generate an ecdsa signature for a given pre-hashed message. Read more
Source§

fn insert( &self, key_type: KeyTypeId, suri: &str, public: &[u8], ) -> Result<(), ()>

Insert a new secret key.
Source§

fn keys(&self, key_type: KeyTypeId) -> Result<Vec<Vec<u8>>, Error>

List all supported keys of a given type. Read more
Source§

fn has_keys(&self, public_keys: &[(Vec<u8>, KeyTypeId)]) -> bool

Checks if the private keys for the given public key and key type combinations exist. Read more
Source§

fn sign_with( &self, id: KeyTypeId, crypto_id: CryptoTypeId, public: &[u8], msg: &[u8], ) -> Result<Option<Vec<u8>>, Error>

Convenience method to sign a message using the given key type and a raw public key for secret lookup. Read more
Source§

impl<L, S> Layer<S> for Arc<L>
where L: Layer<S>, S: Subscriber,

Source§

fn on_layer(&mut self, subscriber: &mut S)

Performs late initialization when attaching a Layer to a Subscriber. Read more
Source§

fn new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)

Notifies this layer that a new span was constructed with the given Attributes and Id.
Source§

fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest

Registers a new callsite with this layer, returning whether or not the layer is interested in being notified about the callsite, similarly to Subscriber::register_callsite. Read more
Source§

fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool

Returns true if this layer is interested in a span or event with the given metadata in the current Context, similarly to Subscriber::enabled. Read more
Source§

fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, S>)

Notifies this layer that a span with the given Id recorded the given values.
Source§

fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)

Notifies this layer that a span with the ID span recorded that it follows from the span with the ID follows.
Source§

fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)

Notifies this layer that an event has occurred.
Source§

fn on_enter(&self, id: &Id, ctx: Context<'_, S>)

Notifies this layer that a span with the given ID was entered.
Source§

fn on_exit(&self, id: &Id, ctx: Context<'_, S>)

Notifies this layer that the span with the given ID was exited.
Source§

fn on_close(&self, id: Id, ctx: Context<'_, S>)

Notifies this layer that the span with the given ID has been closed.
Source§

fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)

Notifies this layer that a span ID has been cloned, and that the subscriber returned a different ID.
Source§

fn and_then<L>(self, layer: L) -> Layered<L, Self, S>
where L: Layer<S>, Self: Sized,

Composes this layer around the given Layer, returning a Layered struct implementing Layer. Read more
Source§

fn with_subscriber(self, inner: S) -> Layered<Self, S>
where Self: Sized,

Composes this Layer with the given Subscriber, returning a Layered struct that implements Subscriber. Read more
Source§

fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>
where Self: Sized, F: Filter<S>,

Combines self with a Filter, returning a Filtered layer. Read more
Source§

impl<S> Layer<S> for Arc<dyn Layer<S> + Send + Sync>
where S: Subscriber,

Source§

fn on_layer(&mut self, subscriber: &mut S)

Performs late initialization when attaching a Layer to a Subscriber. Read more
Source§

fn new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)

Notifies this layer that a new span was constructed with the given Attributes and Id.
Source§

fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest

Registers a new callsite with this layer, returning whether or not the layer is interested in being notified about the callsite, similarly to Subscriber::register_callsite. Read more
Source§

fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool

Returns true if this layer is interested in a span or event with the given metadata in the current Context, similarly to Subscriber::enabled. Read more
Source§

fn on_record(&self, span: &Id, values: &Record<'_>, ctx: Context<'_, S>)

Notifies this layer that a span with the given Id recorded the given values.
Source§

fn on_follows_from(&self, span: &Id, follows: &Id, ctx: Context<'_, S>)

Notifies this layer that a span with the ID span recorded that it follows from the span with the ID follows.
Source§

fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)

Notifies this layer that an event has occurred.
Source§

fn on_enter(&self, id: &Id, ctx: Context<'_, S>)

Notifies this layer that a span with the given ID was entered.
Source§

fn on_exit(&self, id: &Id, ctx: Context<'_, S>)

Notifies this layer that the span with the given ID was exited.
Source§

fn on_close(&self, id: Id, ctx: Context<'_, S>)

Notifies this layer that the span with the given ID has been closed.
Source§

fn on_id_change(&self, old: &Id, new: &Id, ctx: Context<'_, S>)

Notifies this layer that a span ID has been cloned, and that the subscriber returned a different ID.
Source§

fn and_then<L>(self, layer: L) -> Layered<L, Self, S>
where L: Layer<S>, Self: Sized,

Composes this layer around the given Layer, returning a Layered struct implementing Layer. Read more
Source§

fn with_subscriber(self, inner: S) -> Layered<Self, S>
where Self: Sized,

Composes this Layer with the given Subscriber, returning a Layered struct that implements Subscriber. Read more
Source§

fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>
where Self: Sized, F: Filter<S>,

Combines self with a Filter, returning a Filtered layer. Read more
Source§

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

Source§

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

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

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

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

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

Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be logged. Read more
Source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
Source§

fn flush(&self)

Flushes any buffered records. Read more
Source§

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

Source§

type Writer = &'a W

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

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

Returns an instance of Writer. Read more
Source§

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
Source§

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

Source§

type Writer = ArcWriter<W>

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

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

Returns an instance of Writer. Read more
Source§

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

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

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

Source§

fn max_encoded_len() -> usize

Upper bound, in bytes, of the maximum encoded size of this item.
Source§

impl<U> Middleware for Arc<U>
where U: Middleware + ?Sized, Arc<U>: Sync + Send + Debug,

Source§

type Error = <U as Middleware>::Error

Error type returned by most operations
Source§

type Provider = <U as Middleware>::Provider

The JSON-RPC client type at the bottom of the stack
Source§

type Inner = <U as Middleware>::Inner

The next-lower middleware in the middleware stack
Source§

fn inner(&self) -> &<Arc<U> as Middleware>::Inner

Get a reference to the next-lower middleware in the middleware stack
Source§

fn convert_err(p: ProviderError) -> <Arc<U> as Middleware>::Error

Convert a provider error into the associated error type by successively converting it to every intermediate middleware error
Source§

fn provider(&self) -> &Provider<<Arc<U> as Middleware>::Provider>

The HTTP or Websocket provider.
Source§

fn default_sender(&self) -> Option<H160>

Return the default sender (if any). This will typically be the connected node’s first address, or the address of a Signer in a lower middleware stack
Source§

fn client_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the current client version using the web3_clientVersion RPC.
Source§

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Fill necessary details of a transaction for dispatch Read more
Source§

fn get_block_number<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U64, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Get the block number
Source§

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Get the block header by number or hash
Source§

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'life0, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

Sends the transaction to the entire Ethereum network and returns the transaction’s hash. This will consume gas from the account that signed the transaction. This call will fail if no signer is available, and the RPC node does not have an unlocked accounts
Source§

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Send + Sync>, ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Arc<U>: 'async_trait,

Send a transaction with a simple escalation policy. Read more
Source§

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<H160, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Returns the address that the ens_name resolves to (or None if not configured). Read more
Source§

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160, ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the ENS name the address resolves to (or None if not configured). Read more
Source§

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Url, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Returns the avatar HTTP link of the avatar that the ens_name resolves to (or None if not configured) Read more
Source§

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT, ) -> Pin<Box<dyn Future<Output = Result<Url, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the URL (not necesserily HTTP) of the image behind a token. Read more
Source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Arc<U>: 'async_trait,

Fetch a field for the ens_name (no None if not configured). Read more
Source§

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Gets the block at block_hash_or_number (transaction hashes only)
Source§

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Gets the block at block_hash_or_number (full transactions included)
Source§

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Gets the block uncle count at block_hash_or_number
Source§

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Gets the block uncle at block_hash_or_number and idx
Source§

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

Returns the nonce of the address
Source§

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Sends a transaction to a single Ethereum node and return the estimated amount of gas required (as a U256) to send it This is free, but only an estimate. Providing too little gas will result in a transaction being rejected (while still consuming all provided gas).
Source§

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Sends the read-only (constant) transaction to a single Ethereum node and return the result (as bytes) of executing it. This is free, since it does not change any state on the blockchain.
Source§

fn syncing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Return current client syncing status. If IsFalse sync is over.
Source§

fn get_chainid<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.
Source§

fn get_net_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the network version.
Source§

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

Returns the account’s balance
Source§

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Arc<U>: 'async_trait,

Gets the transaction with transaction_hash
Source§

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Arc<U>: 'async_trait,

Gets the transaction with block and index
Source§

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T, ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Arc<U>: 'async_trait,

Gets the transaction receipt with transaction_hash
Source§

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Arc<U>: 'async_trait,

Returns all receipts for a block. Read more
Source§

fn get_gas_price<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Gets the current gas price as estimated by the node
Source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: U256, _: Vec<Vec<U256>>) -> (U256, U256)>, ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Gets a heuristic recommendation of max fee per gas and max priority fee per gas for EIP-1559 compatible transactions.
Source§

fn get_accounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Gets the accounts on the node
Source§

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes, ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, <Arc<U> as Middleware>::Provider>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<U>: 'async_trait,

Send the raw RLP encoded transaction to the entire Ethereum network and returns the transaction’s hash This will consume gas from the account that signed the transaction.
Source§

fn is_signer<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

This returns true if either the middleware stack contains a SignerMiddleware, or the JSON-RPC provider has an unlocked key that can sign using the eth_sign call. If none of the above conditions are met, then the middleware stack is not capable of signing data.
Source§

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160, ) -> Pin<Box<dyn Future<Output = Result<Signature, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Arc<U>: 'async_trait,

Signs data using a specific account. This account needs to be unlocked, or the middleware stack must contain a SignerMiddleware
Source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160, ) -> Pin<Box<dyn Future<Output = Result<Signature, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Sign a transaction via RPC call
Source§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Returns an array (possibly empty) of logs that match the filter
Source§

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64, ) -> LogQuery<'a, <Arc<U> as Middleware>::Provider>

Returns a stream of logs are loaded in pages of given page size
Source§

fn watch<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'a, <Arc<U> as Middleware>::Provider, Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Arc<U>: 'async_trait,

Streams event logs matching the filter. Read more
Source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Streams pending transactions. Read more
Source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Streams new block hashes Read more
Source§

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

Returns the deployed code at a given address
Source§

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, from: T, location: H256, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<H256, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

Get the storage of an address for a particular slot location
Source§

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Arc<U>: 'async_trait,

Returns the EIP-1186 proof response https://github.com/ethereum/EIPs/issues/1186
Source§

fn mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns an indication if this node is currently mining.
Source§

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String, ) -> Pin<Box<dyn Future<Output = Result<H160, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Sends the given key to the node to be encrypted with the provided passphrase and stored. Read more
Source§

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Arc<U>: 'async_trait,

Prompts the node to decrypt the given account from its keystore. Read more
Source§

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Requests adding the given peer, returning a boolean representing whether or not the peer was accepted for tracking.
Source§

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Requests adding the given peer as a trusted peer, which the node will always connect to even when its peer slots are full.
Source§

fn node_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns general information about the node as well as information about the running p2p protocols (e.g. eth, snap).
Source§

fn peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the list of peers currently connected to the node.
Source§

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Requests to remove the given peer, returning true if the enode was successfully parsed and the peer was removed.
Source§

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Requests to remove the given peer, returning a boolean representing whether or not the enode url passed was validated. A return value of true does not necessarily mean that the peer was disconnected.
Source§

fn start_mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Starts the miner.
Source§

fn stop_mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Stop terminates the miner, both at the consensus engine level as well as at the block creation level.
Source§

fn txpool_content<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn txpool_inspect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn txpool_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

After replaying any previous transactions in the same block, Replays a transaction, returning the traces configured with passed options
Source§

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions, ) -> Pin<Box<dyn Future<Output = Result<GethTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

Executes the given call and returns a number of possible traces for it
Source§

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Replays all transactions in a given block (specified by block number) and returns the traces configured with passed options Ref: Here
Source§

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Replays all transactions in a given block (specified by block hash) and returns the traces configured with passed options Ref: Here
Source§

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

Executes the given call and returns a number of possible traces for it
Source§

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber>, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Arc<U>: 'async_trait,

Executes given calls and returns a number of possible traces for each call
Source§

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Traces a call to eth_sendRawTransaction without making the call, returning the traces
Source§

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Replays a transaction, returning the traces
Source§

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Replays all transactions in a block returning the requested traces for each transaction
Source§

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns traces created at given block
Source§

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Return traces matching the given filter
Source§

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T>, ) -> Pin<Box<dyn Future<Output = Result<Trace, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Arc<U>: 'async_trait,

Returns trace at the given position
Source§

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Returns all traces of a given transaction
Source§

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Arc<U>: 'async_trait,

Returns all receipts for that block. Must be done on a parity node.
Source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, Block<H256>>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

Subscribe to a stream of incoming blocks. Read more
Source§

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, H256>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

Subscribe to a stream of pending transaction hashes. Read more
Source§

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, <Arc<U> as Middleware>::Provider, Transaction>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

Subscribe to a stream of pending transaction bodies. Read more
Source§

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, <Arc<U> as Middleware>::Provider, Log>, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, <Arc<U> as Middleware>::Provider: PubsubClient, Arc<U>: 'async_trait,

Subscribe to a stream of event logs matchin the provided Filter. Read more
Source§

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64], ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Arc<U>: 'async_trait,

Query the node for a FeeHistory object. This objct contains information about the EIP-1559 base fee in past blocks, as well as gas utilization within those blocks. Read more
Source§

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, <Arc<U> as Middleware>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Query the node for an EIP-2930 Access List. Read more
Source§

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

Source§

fn next_message<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Option<ProtocolMessage>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Source§

fn send_message<'life0, 'async_trait>( &'life0 self, message: ProtocolMessage, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Source§

fn build_protocol_message<Payload>( identifier_info: IdentifierInfo, from: u16, to: Option<u16>, payload: &Payload, from_account_id: Option<Public>, to_network_id: Option<Public>, ) -> ProtocolMessage
where Payload: Serialize,

Source§

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

Source§

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.
Source§

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

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

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

Return an iterator of all signer addresses.
Source§

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.
Source§

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

Asynchronously sign an unsigned transaction.
Source§

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.
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));
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
Source§

impl ProvideCredentials for Arc<dyn ProvideCredentials>

Source§

fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>
where Arc<dyn ProvideCredentials>: 'a,

Returns a future that provides credentials.
Source§

fn fallback_on_interrupt(&self) -> Option<Credentials>

Returns fallback credentials. Read more
Source§

impl<T, N, U> Provider<T, N> for Arc<U>
where T: Transport + Clone, N: Network, U: Provider<T, N>, Arc<U>: Send + Sync,

Source§

fn root(&self) -> &RootProvider<T, N>

Returns the root provider.
Source§

fn builder() -> ProviderBuilder<Identity, Identity, N>
where Arc<U>: Sized,

Returns the ProviderBuilder to build on.
Source§

fn client(&self) -> &RpcClientInner<T>

Returns the RPC client used to send requests. Read more
Source§

fn weak_client(&self) -> Weak<RpcClientInner<T>>

Returns a Weak RPC client used to send requests. Read more
Source§

fn get_accounts(&self) -> ProviderCall<T, [(); 0], Vec<Address>>

Gets the accounts in the remote node. This is usually empty unless you’re using a local node.
Source§

fn get_blob_base_fee(&self) -> ProviderCall<T, [(); 0], Uint<128, 2>, u128>

Returns the base fee per blob gas (blob gas price) in wei.
Source§

fn get_block_number(&self) -> ProviderCall<T, [(); 0], Uint<64, 1>, u64>

Get the last block number available.
Source§

fn call<'req>( &self, tx: &'req <N as Network>::TransactionRequest, ) -> EthCall<'req, T, N, Bytes>

Execute a smart contract call with a transaction request and state overrides, without publishing a transaction. Read more
Source§

fn simulate<'req>( &self, payload: &'req SimulatePayload, ) -> RpcWithBlock<T, &'req SimulatePayload, Vec<SimulatedBlock<<N as Network>::BlockResponse>>>

Executes an arbitrary number of transactions on top of the requested state. Read more
Source§

fn get_chain_id(&self) -> ProviderCall<T, [(); 0], Uint<64, 1>, u64>

Gets the chain ID.
Source§

fn create_access_list<'a>( &self, request: &'a <N as Network>::TransactionRequest, ) -> RpcWithBlock<T, &'a <N as Network>::TransactionRequest, AccessListResult>

Create an EIP-2930 access list.
Source§

fn estimate_gas<'req>( &self, tx: &'req <N as Network>::TransactionRequest, ) -> EthCall<'req, T, N, Uint<64, 1>, u64>

This function returns an EthCall which can be used to get a gas estimate, or to add StateOverride or a BlockId. If no overrides or block ID is provided, the gas estimate will be computed for the latest block with the current state. Read more
Source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(_: u128, _: &[Vec<u128>]) -> Eip1559Estimation>, ) -> Pin<Box<dyn Future<Output = Result<Eip1559Estimation, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Estimates the EIP1559 maxFeePerGas and maxPriorityFeePerGas fields. Read more
Source§

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<U>: '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.
Source§

fn get_gas_price(&self) -> ProviderCall<T, [(); 0], Uint<128, 2>, u128>

Gets the current gas price in wei.
Source§

fn get_account(&self, address: Address) -> RpcWithBlock<T, Address, Account>

Retrieves account information (Account) for the given Address at the particular BlockId.
Source§

fn get_balance( &self, address: Address, ) -> RpcWithBlock<T, Address, Uint<256, 4>>

Gets the balance of the account. Read more
Source§

fn get_block<'life0, 'async_trait>( &'life0 self, block: BlockId, kind: BlockTransactionsKind, ) -> Pin<Box<dyn Future<Output = Result<Option<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Gets a block by either its hash, tag, or number, with full transactions or only hashes.
Source§

fn get_block_by_hash<'life0, 'async_trait>( &'life0 self, hash: FixedBytes<32>, kind: BlockTransactionsKind, ) -> Pin<Box<dyn Future<Output = Result<Option<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Gets a block by its BlockHash, with full transactions or only hashes.
Source§

fn get_block_by_number<'life0, 'async_trait>( &'life0 self, number: BlockNumberOrTag, hydrate: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Get a block by its number.
Source§

fn get_block_receipts( &self, block: BlockId, ) -> ProviderCall<T, (BlockId,), Option<Vec<<N as Network>::ReceiptResponse>>>

Gets the selected block BlockId receipts.
Source§

fn get_code_at(&self, address: Address) -> RpcWithBlock<T, Address, Bytes>

Gets the bytecode located at the corresponding Address.
Source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<T, (Uint<256, 4>,), Vec<FixedBytes<32>>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Watch for new blocks by polling the provider with eth_getFilterChanges. Read more
Source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<T, (Uint<256, 4>,), Vec<FixedBytes<32>>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Watch for new pending transaction by polling the provider with eth_getFilterChanges. Read more
Source§

fn watch_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<T, (Uint<256, 4>,), Vec<Log>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Watch for new logs using the given filter by polling the provider with eth_getFilterChanges. Read more
Source§

fn watch_full_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollerBuilder<T, (Uint<256, 4>,), Vec<<N as Network>::TransactionResponse>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Watch for new pending transaction bodies by polling the provider with eth_getFilterChanges. Read more
Source§

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<U>: 'async_trait,

Get a list of values that have been added since the last poll. Read more
Source§

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<U>: 'async_trait,

Watch for the confirmation of a single pending transaction with the given configuration. Read more
Source§

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<U>: 'async_trait,

Retrieves a Vec<Log> with the given Filter.
Source§

fn get_proof( &self, address: Address, keys: Vec<FixedBytes<32>>, ) -> RpcWithBlock<T, (Address, Vec<FixedBytes<32>>), EIP1186AccountProofResponse>

Get the account and storage values of the specified account including the merkle proofs. Read more
Source§

fn get_storage_at( &self, address: Address, key: Uint<256, 4>, ) -> RpcWithBlock<T, (Address, Uint<256, 4>), Uint<256, 4>>

Gets the specified storage value from Address.
Source§

fn get_transaction_by_hash( &self, hash: FixedBytes<32>, ) -> ProviderCall<T, (FixedBytes<32>,), Option<<N as Network>::TransactionResponse>>

Gets a transaction by its TxHash.
Source§

fn get_transaction_by_block_hash_and_index( &self, block_hash: FixedBytes<32>, index: usize, ) -> ProviderCall<T, (FixedBytes<32>, Index), Option<<N as Network>::TransactionResponse>>

Gets a transaction by block hash and transaction index position.
Source§

fn get_raw_transaction_by_block_hash_and_index( &self, block_hash: FixedBytes<32>, index: usize, ) -> ProviderCall<T, (FixedBytes<32>, Index), Option<Bytes>>

Gets a raw transaction by block hash and transaction index position.
Source§

fn get_transaction_by_block_number_and_index( &self, block_number: BlockNumberOrTag, index: usize, ) -> ProviderCall<T, (BlockNumberOrTag, Index), Option<<N as Network>::TransactionResponse>>

Gets a transaction by block number and transaction index position.
Source§

fn get_raw_transaction_by_block_number_and_index( &self, block_number: BlockNumberOrTag, index: usize, ) -> ProviderCall<T, (BlockNumberOrTag, Index), Option<Bytes>>

Gets a raw transaction by block number and transaction index position.
Source§

fn get_raw_transaction_by_hash( &self, hash: FixedBytes<32>, ) -> ProviderCall<T, (FixedBytes<32>,), Option<Bytes>>

Returns the EIP-2718 encoded transaction if it exists, see also Decodable2718. Read more
Source§

fn get_transaction_count( &self, address: Address, ) -> RpcWithBlock<T, Address, Uint<64, 1>, u64>

Gets the transaction count (AKA “nonce”) of the corresponding address.
Source§

fn get_transaction_receipt( &self, hash: FixedBytes<32>, ) -> ProviderCall<T, (FixedBytes<32>,), Option<<N as Network>::ReceiptResponse>>

Gets a transaction receipt if it exists, by its TxHash.
Source§

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<U>: 'async_trait,

Gets an uncle block through the tag BlockId and index u64.
Source§

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<U>: 'async_trait,

Gets the number of uncles for the block specified by the tag BlockId.
Source§

fn get_max_priority_fee_per_gas( &self, ) -> ProviderCall<T, [(); 0], Uint<128, 2>, u128>

Returns a suggestion for the current maxPriorityFeePerGas in wei.
Source§

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<U>: 'async_trait,

Notify the provider that we are interested in new blocks. Read more
Source§

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<U>: 'async_trait,

Notify the provider that we are interested in logs that match the given filter. Read more
Source§

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<U>: 'async_trait,

Notify the provider that we are interested in new pending transactions. Read more
Source§

fn send_raw_transaction<'life0, 'life1, 'async_trait>( &'life0 self, encoded_tx: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<T, N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Broadcasts a raw transaction RLP bytes to the network. Read more
Source§

fn send_transaction<'life0, 'async_trait>( &'life0 self, tx: <N as Network>::TransactionRequest, ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<T, N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Broadcasts a transaction to the network. Read more
Source§

fn send_tx_envelope<'life0, 'async_trait>( &'life0 self, tx: <N as Network>::TxEnvelope, ) -> Pin<Box<dyn Future<Output = Result<PendingTransactionBuilder<T, N>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Broadcasts a transaction envelope to the network. Read more
Source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Subscription<<N as Network>::BlockResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Subscribe to a stream of new block headers. Read more
Source§

fn subscribe_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Subscription<FixedBytes<32>>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Subscribe to a stream of pending transaction hashes. Read more
Source§

fn subscribe_full_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Subscription<<N as Network>::TransactionResponse>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<U>: 'async_trait,

Subscribe to a stream of pending transaction bodies. Read more
Source§

fn subscribe_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<Subscription<Log>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<U>: 'async_trait,

Subscribe to a stream of logs matching given filter. Read more
Source§

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<U>: 'async_trait,

Cancels a subscription given the subscription ID.
Source§

fn syncing(&self) -> ProviderCall<T, [(); 0], SyncStatus>

Gets syncing info.
Source§

fn get_client_version(&self) -> ProviderCall<T, [(); 0], String>

Gets the client version.
Source§

fn get_sha3(&self, data: &[u8]) -> ProviderCall<T, (String,), FixedBytes<32>>

Gets the Keccak-256 hash of the given data.
Source§

fn get_net_version(&self) -> ProviderCall<T, [(); 0], Uint<64, 1>, u64>

Gets the network ID. Same as eth_chainId.
Source§

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: RpcParam + 'async_trait, R: RpcReturn + 'async_trait, Arc<U>: Sized + 'async_trait,

Sends a raw JSON-RPC request. Read more
Source§

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<U>: 'async_trait,

Sends a raw JSON-RPC request with type-erased parameters and return. Read more
Source§

fn transaction_request(&self) -> <N as Network>::TransactionRequest

Creates a new TransactionRequest.
Source§

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 + RpcReturn,

Get a list of values that have been added since the last poll. Read more
Source§

fn subscribe<'life0, 'async_trait, P, R>( &'life0 self, params: P, ) -> Pin<Box<dyn Future<Output = Result<Subscription<R>, RpcError<TransportErrorKind>>> + Send + 'async_trait>>
where 'life0: 'async_trait, P: RpcParam + 'async_trait, R: RpcReturn + 'async_trait, Self: Sized + 'async_trait,

Subscribe to an RPC event.
1.73.0 · Source§

impl Read for Arc<File>

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
Source§

fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
Source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
Source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Reads all bytes until EOF in this source, placing them into buf. Read more
Source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Reads all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · Source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Reads the exact number of bytes required to fill buf. Read more
Source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Reads the exact number of bytes required to fill cursor. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · Source§

fn bytes(self) -> Bytes<Self>
where Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · Source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where R: Read, Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · Source§

fn take(self, limit: u64) -> Take<Self>
where Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
Source§

impl ReadRuntimeVersion for Arc<dyn ReadRuntimeVersion>

Source§

fn read_runtime_version( &self, wasm_code: &[u8], ext: &mut dyn Externalities, ) -> Result<Vec<u8>, String>

Reads the runtime version information from the given wasm code. Read more
Source§

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

Source§

fn describe_counter( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a counter. Read more
Source§

fn describe_gauge( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a gauge. Read more
Source§

fn describe_histogram( &self, key: KeyName, unit: Option<Unit>, description: Cow<'static, str>, )

Describes a histogram. Read more
Source§

fn register_counter(&self, key: &Key, metadata: &Metadata<'_>) -> Counter

Registers a counter.
Source§

fn register_gauge(&self, key: &Key, metadata: &Metadata<'_>) -> Gauge

Registers a gauge.
Source§

fn register_histogram(&self, key: &Key, metadata: &Metadata<'_>) -> Histogram

Registers a histogram.
Source§

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

Source§

fn request_raw<'a>( &'a self, method: &'a str, params: Option<Box<RawValue>>, ) -> Pin<Box<dyn Future<Output = Result<Box<RawValue>, RpcError>> + Send + 'a>>

Make a raw request for which we expect a single response back from. Implementations should expect that the params will either be None, or be an already-serialized JSON array of parameters. Read more
Source§

fn subscribe_raw<'a>( &'a self, sub: &'a str, params: Option<Box<RawValue>>, unsub: &'a str, ) -> Pin<Box<dyn Future<Output = Result<RawRpcSubscription, RpcError>> + Send + 'a>>

Subscribe to some method. Implementations should expect that the params will either be None, or be an already-serialized JSON array of parameters. Read more
1.73.0 · Source§

impl Seek for Arc<File>

Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
Source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.51.0 · Source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
1.80.0 · Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more
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.
Source§

impl<Request, S> Service<Request> for Arc<S>
where S: Service<Request> + ?Sized,

Source§

type Response = <S as Service<Request>>::Response

Responses given by the service.
Source§

type Error = <S as Service<Request>>::Error

Errors produced by the service. Read more
Source§

type Future = <S as Service<Request>>::Future

The future response value.
Source§

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
Source§

impl<Sig, U> SignerSync<Sig> for Arc<U>
where U: SignerSync<Sig> + ?Sized,

Source§

fn sign_hash_sync(&self, hash: &FixedBytes<32>) -> Result<Sig, Error>

Signs the given hash.
Source§

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.
Source§

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

Returns the signer’s chain ID.
Source§

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

Source§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

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

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

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

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

Source§

fn resolve(&self) -> Result<DynSolType, Error>

Resolve the type into a value.
Source§

impl<S> Subscriber for Arc<S>
where S: Subscriber + ?Sized,

Source§

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
Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Returns true if a span or event with the specified metadata would be recorded. Read more
Source§

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
Source§

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
Source§

fn record(&self, span: &Id, values: &Record<'_>)

Record a set of values on a span. Read more
Source§

fn record_follows_from(&self, span: &Id, follows: &Id)

Adds an indication that span follows from the span with the id follows. Read more
Source§

fn event_enabled(&self, event: &Event<'_>) -> bool

Determine if an Event should be recorded. Read more
Source§

fn event(&self, event: &Event<'_>)

Records that an Event has occurred. Read more
Source§

fn enter(&self, span: &Id)

Records that a span has been entered. Read more
Source§

fn exit(&self, span: &Id)

Records that a span has been exited. Read more
Source§

fn clone_span(&self, id: &Id) -> Id

Notifies the subscriber that a span ID has been cloned. Read more
Source§

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
Source§

fn drop_span(&self, id: Id)

👎Deprecated since 0.1.2: use Subscriber::try_close instead
This method is deprecated. Read more
Source§

fn current_span(&self) -> Current

Returns a type representing this subscriber’s view of the current span. Read more
Source§

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
Source§

fn on_register_dispatch(&self, subscriber: &Dispatch)

Invoked when this subscriber becomes a Dispatch. Read more
Source§

impl<H> TrieBackendStorage<H> for Arc<dyn Storage<H>>
where H: Hasher,

Source§

fn get( &self, key: &<H as Hasher>::Out, prefix: (&[u8], Option<u8>), ) -> Result<Option<Vec<u8>>, String>

Get the value stored at key.
1.43.0 · Source§

impl<T, A, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A>
where A: Allocator,

Source§

type Error = Arc<[T], A>

The type returned in the event of a conversion error.
Source§

fn try_from( boxed_slice: Arc<[T], A>, ) -> Result<Arc<[T; N], A>, <Arc<[T; N], A> as TryFrom<Arc<[T], A>>>::Error>

Performs the conversion.
Source§

impl<T, U> TxReceipt<T> for Arc<U>
where U: TxReceipt<T> + ?Sized, Arc<U>: Clone + Debug + PartialEq + Eq + Send + Sync,

Source§

fn status_or_post_state(&self) -> Eip658Value

Returns the status or post state of the transaction. Read more
Source§

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
Source§

fn bloom(&self) -> Bloom

Returns the bloom filter for the logs in the receipt. This operation may be expensive.
Source§

fn bloom_cheap(&self) -> Option<Bloom>

Returns the bloom filter for the logs in the receipt, if it is cheap to compute.
Source§

fn cumulative_gas_used(&self) -> u128

Returns the cumulative gas used in the block after this transaction was executed.
Source§

fn logs(&self) -> &[T]

Returns the logs emitted by this transaction.
Source§

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

Source§

fn address(&self) -> Address

Get the address of the signer.
Source§

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.
Source§

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

Source§

fn address(&self) -> Address

Get the address of the signer.
Source§

fn sign_transaction_sync( &self, tx: &mut (dyn SignableTransaction<Signature> + 'static), ) -> Result<Signature, Error>

Synchronously sign an unsigned transaction.
Source§

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

Source§

type Identity = T

The type identifying for which type info is provided. Read more
Source§

fn type_info() -> Type

Returns the static type identifier for Self.
Source§

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

Source§

fn check(&self) -> Result<(), SerializationError>

Source§

fn batch_check<'a>( batch: impl Iterator<Item = &'a Arc<T>> + Send, ) -> Result<(), SerializationError>
where Arc<T>: 'a,

Source§

impl<T> ValueParserFactory for Arc<T>

Source§

type Parser = MapValueParser<<T as ValueParserFactory>::Parser, fn(_: T) -> Arc<T>>

Generated parser, usually ValueParser. Read more
Source§

fn value_parser() -> <Arc<T> as ValueParserFactory>::Parser

Create the specified Self::Parser
Source§

impl<T> WasmModuleResources for Arc<T>

Source§

type FuncType = <T as WasmModuleResources>::FuncType

The function type used for validation.
Source§

fn table_at(&self, at: u32) -> Option<TableType>

Returns the table at given index if any.
Source§

fn memory_at(&self, at: u32) -> Option<MemoryType>

Returns the linear memory at given index.
Source§

fn tag_at(&self, at: u32) -> Option<&<Arc<T> as WasmModuleResources>::FuncType>

Returns the tag at given index.
Source§

fn global_at(&self, at: u32) -> Option<GlobalType>

Returns the global variable at given index.
Source§

fn func_type_at( &self, type_idx: u32, ) -> Option<&<Arc<T> as WasmModuleResources>::FuncType>

Returns the FuncType associated with the given type index.
Source§

fn type_index_of_function(&self, func_idx: u32) -> Option<u32>

Returns the type index associated with the given function index. type_of_function = func_type_at(type_index_of_function)
Source§

fn type_of_function( &self, func_idx: u32, ) -> Option<&<Arc<T> as WasmModuleResources>::FuncType>

Returns the FuncType associated with the given function index.
Source§

fn check_value_type( &self, t: ValType, features: &WasmFeatures, offset: usize, ) -> Result<(), BinaryReaderError>

Check a value type. This requires using func_type_at to check references
Source§

fn element_type_at(&self, at: u32) -> Option<RefType>

Returns the element type at the given index.
Source§

fn matches(&self, t1: ValType, t2: ValType) -> bool

Under the function references proposal, returns whether t1 <= t2. Otherwise, returns whether t1 == t2
Source§

fn element_count(&self) -> u32

Returns the number of elements.
Source§

fn data_count(&self) -> Option<u32>

Returns the number of bytes in the Wasm data section.
Source§

fn is_function_referenced(&self, idx: u32) -> bool

Returns whether the function index is referenced in the module anywhere outside of the start/function sections.
Source§

fn check_heap_type( &self, heap_type: HeapType, features: &WasmFeatures, offset: usize, ) -> Result<(), BinaryReaderError>

Checks that a HeapType is valid, notably its function index if one is used.
Source§

impl<T> WrapperTypeDecode for Arc<T>

Source§

type Wrapped = T

A wrapped type.
1.73.0 · Source§

impl Write for Arc<File>

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Writes a buffer into this writer, returning how many bytes were written. Read more
Source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
Source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
Source§

fn flush(&mut self) -> Result<(), Error>

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.0.0 · Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
Source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · Source§

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

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
Source§

impl<'a, T> Writeable for Arc<T>
where T: Writeable + ?Sized,

Source§

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.
Source§

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.
Source§

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
Source§

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
Source§

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
Source§

impl<T> CartablePointerLike for Arc<T>

Source§

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

Source§

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

Source§

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,

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,

Source§

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

Source§

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,

1.0.0 · Source§

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

Source§

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> WrapperTypeEncode for Arc<T>
where T: ?Sized,

Auto Trait Implementations§

§

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

§

impl<T, A> RefUnwindSafe for Arc<T, A>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A, T> AsBits<T> for A
where A: AsRef<[T]>, T: BitStore,

Source§

fn as_bits<O>(&self) -> &BitSlice<T, O>
where O: BitOrder,

Views self as an immutable bit-slice region with the O ordering.
Source§

fn try_as_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view self as an immutable bit-slice region with the O ordering. Read more
Source§

impl<T, U> AsByteSlice<T> for U
where T: ToByteSlice, U: AsRef<[T]> + ?Sized,

Source§

fn as_byte_slice(&self) -> &[u8]

Source§

impl<P> AsDowncastingAnyProvider for P
where P: AnyProvider + ?Sized,

Source§

fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>

Returns an object implementing DynamicDataProvider<M> when called on AnyProvider
Source§

impl<P> AsDynamicDataProviderAnyMarkerWrap for P

Source§

fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>

Returns an object implementing AnyProvider when called on DynamicDataProvider<AnyMarker>
Source§

impl<T> AsFilelike for T
where T: AsFd,

Source§

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

Borrows the reference. Read more
Source§

fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target>
where Target: FilelikeViewType,

Return a borrowing view of a resource which dereferences to a &Target. Read more
Source§

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

Source§

fn as_raw_filelike(&self) -> i32

Returns the raw value.
Source§

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

Source§

fn as_raw_socketlike(&self) -> i32

Returns the raw value.
Source§

impl<U> AsSliceOf for U
where U: AsRef<[u8]> + ?Sized,

Source§

fn as_slice_of<T>(&self) -> Result<&[T], Error>
where T: FromByteSlice,

Source§

impl<T> AsSocketlike for T
where T: AsFd,

Source§

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

Borrows the reference.
Source§

fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target>
where Target: SocketlikeViewType,

Return a borrowing view of a resource which dereferences to a &Target. Read more
Source§

impl<T> AsSource for T
where T: AsFd,

Source§

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

Returns the borrowed file descriptor.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Base32Len for T
where T: AsRef<[u8]>,

Source§

fn base32_len(&self) -> usize

Calculate the base32 serialized length
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CanonicalSerializeHashExt for T

Source§

impl<T> CheckBase32<Vec<u5>> for T
where T: AsRef<[u8]>,

Source§

type Err = Error

Error type if conversion fails
Source§

fn check_base32(self) -> Result<Vec<u5>, <T as CheckBase32<Vec<u5>>>::Err>

Check if all values are in range and return array-like struct of u5 values
Source§

impl<T> CheckedConversion for T

Source§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
Source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
Source§

impl<T> Clear for T
where T: Default + Eq + PartialEq,

Source§

fn is_clear(&self) -> bool

True iff no bits are set.
Source§

fn clear() -> T

Return the value of Self that is clear.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T, X> Decode for X
where T: Decode + Into<X>, X: WrapperTypeDecode<Wrapped = T>,

Source§

fn decode<I>(input: &mut I) -> Result<X, Error>
where I: Input,

Attempt to deserialise the value from input.
Source§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
Source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

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

Source§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

impl<T> DecodeAsType for T
where T: IntoVisitor,

Source§

fn decode_as_type_maybe_compact<R>( input: &mut &[u8], type_id: <R as TypeResolver>::TypeId, types: &R, is_compact: bool, ) -> Result<T, Error>
where R: TypeResolver,

Source§

fn decode_as_type<R>( input: &mut &[u8], type_id: <R as TypeResolver>::TypeId, types: &R, ) -> Result<Self, Error>
where R: TypeResolver,

Given some input bytes, a type_id, and type registry, attempt to decode said bytes into Self. Implementations should modify the &mut reference to the bytes such that any bytes not used in the course of decoding are still pointed to after decoding is complete.
Source§

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

Source§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8], ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>
where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
Source§

impl<T> DecodeWithMetadata for T
where T: DecodeAsType,

Source§

fn decode_with_metadata( bytes: &mut &[u8], type_id: u32, metadata: &Metadata, ) -> Result<T, Error>

Given some metadata and a type ID, attempt to SCALE decode the provided bytes into Self.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T, X> Encode for X
where T: Encode + ?Sized, X: WrapperTypeEncode<Target = T>,

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
Source§

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

Convert self to an owned vector.
Source§

fn encode_to<W>(&self, dest: &mut W)
where W: Output + ?Sized,

Convert self to a slice and append it to the destination.
Source§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl<T> EncodeWithMetadata for T
where T: EncodeAsType,

Source§

fn encode_with_metadata( &self, type_id: u32, metadata: &Metadata, bytes: &mut Vec<u8>, ) -> Result<(), Error>

SCALE encode this type to bytes, possibly with the help of metadata.

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<E> ErrorClone for E
where E: Error + Clone + Send + Sync + 'static,

Source§

fn clone_box(&self) -> Box<dyn ErrorClone>

Clone the error.
Source§

impl<F, S> FilterExt<S> for F
where F: Filter<S>,

Source§

fn and<B>(self, other: B) -> And<Self, B, S>
where Self: Sized, B: Filter<S>,

Combines this Filter with another Filter s so that spans and events are enabled if and only if both filters return true. Read more
Source§

fn or<B>(self, other: B) -> Or<Self, B, S>
where Self: Sized, B: Filter<S>,

Combines two Filters so that spans and events are enabled if either filter returns true. Read more
Source§

fn not(self) -> Not<Self, S>
where Self: Sized,

Inverts self, returning a filter that enables spans and events only if self would not enable them. Read more
Source§

fn boxed(self) -> Box<dyn Filter<S> + Send + Sync>
where Self: Sized + Send + Sync + 'static,

Boxes self, erasing its concrete type. Read more
Source§

impl<T> FindExt for T
where T: Find + ?Sized,

Source§

fn find<'a>(&self, id: &oid, buffer: &'a mut Vec<u8>) -> Result<Data<'a>, Error>

Like try_find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error.
Source§

fn find_commit<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<CommitRef<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type.
Source§

fn find_tree<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TreeRef<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type.
Source§

fn find_tag<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TagRef<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type.
Source§

fn find_blob<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<BlobRef<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired object type.
Source§

fn find_commit_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<CommitRefIter<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type.
Source§

fn find_tree_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TreeRefIter<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type.
Source§

fn find_tag_iter<'a>( &self, id: &oid, buffer: &'a mut Vec<u8>, ) -> Result<TagRefIter<'a>, Error>

Like find(…), but flattens the Result<Option<_>> into a single Result making a non-existing object an error while returning the desired iterator type.
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromFd for T
where T: From<OwnedFd>,

Source§

fn from_fd(owned_fd: OwnedFd) -> T

👎Deprecated since 1.0.0: FromFd::from_fd is replaced by From<OwnedFd>::from
Constructs a new instance of Self from the given file descriptor. Read more
Source§

fn from_into_fd<Owned>(into_owned: Owned) -> Self
where Owned: Into<OwnedFd>, Self: Sized + From<OwnedFd>,

Constructs a new instance of Self from the given file descriptor converted from into_owned. Read more
Source§

impl<T> FromFilelike for T
where T: From<OwnedFd>,

Source§

fn from_filelike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given filelike object. Read more
Source§

fn from_into_filelike<Owned>(owned: Owned) -> T
where Owned: IntoFilelike,

Constructs a new instance of Self from the given filelike object converted from into_owned. Read more
Source§

impl<T> FromSocketlike for T
where T: From<OwnedFd>,

Source§

fn from_socketlike(owned: OwnedFd) -> T

Constructs a new instance of Self from the given socketlike object.
Source§

fn from_into_socketlike<Owned>(owned: Owned) -> T
where Owned: IntoSocketlike,

Constructs a new instance of Self from the given socketlike object converted from into_owned.
Source§

impl<T, B1, B2> HttpService<B1> for T
where T: Service<Request<B1>, Response = Response<B2>>, B2: Body, <T as Service<Request<B1>>>::Error: Into<Box<dyn Error + Send + Sync>>,

Source§

type ResBody = B2

The Body body of the http::Response.
Source§

type Error = <T as Service<Request<B1>>>::Error

The error type that can occur within this Service. Read more
Source§

type Future = <T as Service<Request<B1>>>::Future

The Future returned by this Service.
Source§

fn call(&mut self, req: Request<B1>) -> <T as HttpService<B1>>::Future

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<E> InstrumentError for E
where TracedError<E>: From<E>,

Source§

type Instrumented = TracedError<E>

The type of the wrapped error after instrumentation
Source§

fn in_current_span(self) -> <E as InstrumentError>::Instrumented

Instrument an Error by bundling it with a SpanTrace Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoResult<T> for T

Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

Source§

impl<C> JsonRpcClientWrapper for C
where C: JsonRpcClient,

Source§

fn request<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: QuorumParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, C: 'async_trait,

Make a request, as crate::JsonRpcClient
Source§

impl<T> KeyedVec for T
where T: Codec,

Source§

fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>

Return an encoding of Self prepended by given slice.
Source§

impl<T> KeystoreUriSanitizer for T
where T: AsRef<Path>,

Source§

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

Source§

fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where Fut: Future<Output = ()> + 'static,

Spawns a task that polls the given future with output () to completion. Read more
Source§

fn spawn_local_with_handle<Fut>( &self, future: Fut, ) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
where Fut: Future + 'static,

Spawns a task that polls the given future to completion and returns a future that resolves to the spawned future’s output. Read more
Source§

impl<'a, M> MakeWriterExt<'a> for M
where M: MakeWriter<'a>,

Source§

fn with_max_level(self, level: Level) -> WithMaxLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or below the provided verbosity Level. For instance, Level::TRACE is considered to be _more verbosethanLevel::INFO`. Read more
Source§

fn with_min_level(self, level: Level) -> WithMinLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or above the provided verbosity Level. Read more
Source§

fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>
where Self: Sized, F: Fn(&Metadata<'_>) -> bool,

Wraps self with a predicate that takes a span or event’s Metadata and returns a bool. The returned MakeWriter’s MakeWriter::make_writer_for method will check the predicate to determine if a writer should be produced for a given span or event. Read more
Source§

fn and<B>(self, other: B) -> Tee<Self, B>
where Self: Sized, B: MakeWriter<'a>,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that produces writers that write to both outputs. Read more
Source§

fn or_else<W, B>(self, other: B) -> OrElse<Self, B>
where Self: Sized + MakeWriter<'a, Writer = EitherWriter<W, Sink>>, B: MakeWriter<'a>, W: Write,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that calls other’s make_writer if self’s make_writer returns OptionalWriter::none. Read more
Source§

impl<M> MakeWriterExt for M
where M: MakeWriter,

Source§

fn with_max_level(self, level: Level) -> WithMaxLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or below the provided verbosity Level. For instance, Level::TRACE is considered to be _more verbosethanLevel::INFO`. Read more
Source§

fn with_min_level(self, level: Level) -> WithMinLevel<Self>
where Self: Sized,

Wraps self and returns a MakeWriter that will only write output for events at or above the provided verbosity Level. Read more
Source§

fn with_filter<F>(self, filter: F) -> WithFilter<Self, F>
where Self: Sized, F: Fn(&Metadata<'_>) -> bool,

Wraps self with a predicate that takes a span or event’s Metadata and returns a bool. The returned MakeWriter’s MakeWriter::make_writer_for method will check the predicate to determine if a writer should be produced for a given span or event. Read more
Source§

fn and<B>(self, other: B) -> Tee<Self, B>
where Self: Sized, B: MakeWriter,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that produces writers that write to both outputs. Read more
Source§

fn or_else<W, B>(self, other: B) -> OrElse<Self, B>
where Self: Sized + MakeWriter<Writer = EitherWriter<W, Sink>>, B: MakeWriter, W: Write,

Combines self with another type implementing MakeWriter, returning a new MakeWriter that calls other’s make_writer if self’s make_writer returns OptionalWriter::none. Read more
Source§

impl<M> MiddlewareBuilder for M
where M: Middleware + 'static,

Source§

fn wrap_into<F, T>(self, f: F) -> T
where F: FnOnce(Self) -> T, T: Middleware,

Wraps self inside a new Middleware. Read more
Source§

fn with_signer<S>(self, s: S) -> SignerMiddleware<Self, S>
where S: Signer,

Wraps self inside a SignerMiddleware.
Source§

fn nonce_manager(self, address: H160) -> NonceManagerMiddleware<Self>

Wraps self inside a NonceManagerMiddleware.
Source§

fn gas_oracle<G>(self, gas_oracle: G) -> GasOracleMiddleware<Self, G>
where G: GasOracle,

Wraps self inside a GasOracleMiddleware.
Source§

impl<W> Output for W
where W: Write,

Source§

fn write(&mut self, bytes: &[u8])

Write to the output.
Source§

fn push_byte(&mut self, byte: u8)

Write a single byte to the output.
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
Source§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
Source§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
Source§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
Source§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
Source§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
Source§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
Source§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
Source§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
Source§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
Source§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
Source§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
Source§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
Source§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
Source§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
Source§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
Source§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
Source§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
Source§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<S> ParseFormatted for S
where S: AsRef<str>,

Source§

fn parse_formatted<F, N>(&self, format: &F) -> Result<N, Error>
where F: Format, N: FromFormattedStr,

Converts self (typically a formatted string) into a number (see Examples above).
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R> ReadBytesExt for R
where R: Read + ?Sized,

Source§

fn read_u8(&mut self) -> Result<u8, Error>

Reads an unsigned 8 bit integer from the underlying reader. Read more
Source§

fn read_i8(&mut self) -> Result<i8, Error>

Reads a signed 8 bit integer from the underlying reader. Read more
Source§

fn read_u16<T>(&mut self) -> Result<u16, Error>
where T: ByteOrder,

Reads an unsigned 16 bit integer from the underlying reader. Read more
Source§

fn read_i16<T>(&mut self) -> Result<i16, Error>
where T: ByteOrder,

Reads a signed 16 bit integer from the underlying reader. Read more
Source§

fn read_u24<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 24 bit integer from the underlying reader. Read more
Source§

fn read_i24<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 24 bit integer from the underlying reader. Read more
Source§

fn read_u32<T>(&mut self) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 32 bit integer from the underlying reader. Read more
Source§

fn read_i32<T>(&mut self) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 32 bit integer from the underlying reader. Read more
Source§

fn read_u48<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 48 bit integer from the underlying reader. Read more
Source§

fn read_i48<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 48 bit integer from the underlying reader. Read more
Source§

fn read_u64<T>(&mut self) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 64 bit integer from the underlying reader. Read more
Source§

fn read_i64<T>(&mut self) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 64 bit integer from the underlying reader. Read more
Source§

fn read_u128<T>(&mut self) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned 128 bit integer from the underlying reader. Read more
Source§

fn read_i128<T>(&mut self) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed 128 bit integer from the underlying reader. Read more
Source§

fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader. Read more
Source§

fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader. Read more
Source§

fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>
where T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader.
Source§

fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>
where T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader.
Source§

fn read_f32<T>(&mut self) -> Result<f32, Error>
where T: ByteOrder,

Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
Source§

fn read_f64<T>(&mut self) -> Result<f64, Error>
where T: ByteOrder,

Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
Source§

fn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more
Source§

fn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more
Source§

fn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more
Source§

fn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more
Source§

fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>

Reads a sequence of signed 8 bit integers from the underlying reader. Read more
Source§

fn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 16 bit integers from the underlying reader. Read more
Source§

fn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 32 bit integers from the underlying reader. Read more
Source§

fn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 64 bit integers from the underlying reader. Read more
Source§

fn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of signed 128 bit integers from the underlying reader. Read more
Source§

fn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more
Source§

fn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where T: ByteOrder,

👎Deprecated since 1.2.0: please use read_f32_into instead
DEPRECATED. Read more
Source§

fn read_f64_into<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where T: ByteOrder,

Reads a sequence of IEEE754 double-precision (8 bytes) floating point numbers from the underlying reader. Read more
Source§

fn read_f64_into_unchecked<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where T: ByteOrder,

👎Deprecated since 1.2.0: please use read_f64_into instead
DEPRECATED. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatedConversion for T

Source§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
Source§

impl<T> SectionExt for T
where T: Display + Send + Sync + 'static,

Source§

fn header<C>(self, header: C) -> IndentedSection<C, T>
where C: Display + Send + Sync + 'static,

Add a header to a Section and indent the body Read more
Source§

impl<Sp> SpawnExt for Sp
where Sp: Spawn + ?Sized,

Source§

fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where Fut: Future<Output = ()> + Send + 'static,

Spawns a task that polls the given future with output () to completion. Read more
Source§

fn spawn_with_handle<Fut>( &self, future: Fut, ) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
where Fut: Future + Send + 'static, <Fut as Future>::Output: Send,

Spawns a task that polls the given future to completion and returns a future that resolves to the spawned future’s output. Read more
Source§

impl<S> SubscriberExt for S
where S: Subscriber,

Source§

fn with<L>(self, layer: L) -> Layered<L, Self>
where L: Layer<Self>, Self: Sized,

Wraps self with the provided layer.
Source§

impl<S> SubscriberExt for S
where S: Subscriber,

Source§

fn with<L>(self, layer: L) -> Layered<L, Self>
where L: Layer<Self>, Self: Sized,

Wraps self with the provided layer.
Source§

impl<T> SubscriberInitExt for T
where T: Into<Dispatch>,

Source§

fn set_default(self) -> DefaultGuard

Sets self as the default subscriber in the current scope, returning a guard that will unset it when dropped. Read more
Source§

fn try_init(self) -> Result<(), TryInitError>

Attempts to set self as the global default subscriber in the current scope, returning an error if one is already set. Read more
Source§

fn init(self)

Attempts to set self as the global default subscriber in the current scope, panicking if this fails. Read more
Source§

impl<T> SubscriberInitExt for T
where T: Into<Dispatch>,

Source§

fn set_default(self) -> DefaultGuard

Sets self as the default subscriber in the current scope, returning a guard that will unset it when dropped. Read more
Source§

fn try_init(self) -> Result<(), TryInitError>

Attempts to set self as the global default subscriber in the current scope, returning an error if one is already set. Read more
Source§

fn init(self)

Attempts to set self as the global default subscriber in the current scope, panicking if this fails. Read more
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToBase32 for T
where T: AsRef<[u8]>,

Source§

fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err>
where W: WriteBase32,

Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate.
Source§

fn to_base32(&self) -> Vec<u5>

Convert Self to base32 vector
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca)
Source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA)
Source§

impl<T> ToHex for T
where T: AsRef<[u8]>,

Source§

fn encode_hex<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).
Source§

fn encode_hex_upper<U>(&self) -> U
where U: FromIterator<char>,

👎Deprecated: use ToHexExt instead
Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA).
Source§

impl<T> ToHexExt for T
where T: AsRef<[u8]>,

Source§

fn encode_hex(&self) -> String

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca).
Source§

fn encode_hex_upper(&self) -> String

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA).
Source§

fn encode_hex_with_prefix(&self) -> String

Encode the hex strict representing self into the result with prefix 0x. Lower case letters are used (e.g. 0xf9b4ca).
Source§

fn encode_hex_upper_with_prefix(&self) -> String

Encode the hex strict representing self into the result with prefix 0X. Upper case letters are used (e.g. 0xF9B4CA).
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ValueSize for T

Source§

fn value_size(&self) -> usize

The size of this value in bytes, excluding allocated data. Read more
Source§

fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usize
where T: 'item,

The total sum of the sizes of all values in the given iterator, in bytes. This is default-implemented by computing ValueSize::value_size on every element and summing them. For Sized types, a more potentially efficient implementation using Iterator::count is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more
Source§

fn value_size_sum_exact_size_iter<'item>( iterator: impl ExactSizeIterator<Item = &'item T>, ) -> usize
where T: 'item,

The total sum of the sizes of all values in the given exact-size-iterator, in bytes. This is default-implemented by using ValueSize::value_size_sum_iter. For Sized types, a usually more efficient implementation using ExactSizeIterator::len is provided. If you are implementing this trait manually, it is unlikely to be more efficient to provide a manual implementation here. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<W> WriteBytesExt for W
where W: Write + ?Sized,

Source§

fn write_u8(&mut self, n: u8) -> Result<(), Error>

Writes an unsigned 8 bit integer to the underlying writer. Read more
Source§

fn write_i8(&mut self, n: i8) -> Result<(), Error>

Writes a signed 8 bit integer to the underlying writer. Read more
Source§

fn write_u16<T>(&mut self, n: u16) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 16 bit integer to the underlying writer. Read more
Source§

fn write_i16<T>(&mut self, n: i16) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 16 bit integer to the underlying writer. Read more
Source§

fn write_u24<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 24 bit integer to the underlying writer. Read more
Source§

fn write_i24<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 24 bit integer to the underlying writer. Read more
Source§

fn write_u32<T>(&mut self, n: u32) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 32 bit integer to the underlying writer. Read more
Source§

fn write_i32<T>(&mut self, n: i32) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 32 bit integer to the underlying writer. Read more
Source§

fn write_u48<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 48 bit integer to the underlying writer. Read more
Source§

fn write_i48<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 48 bit integer to the underlying writer. Read more
Source§

fn write_u64<T>(&mut self, n: u64) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 64 bit integer to the underlying writer. Read more
Source§

fn write_i64<T>(&mut self, n: i64) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 64 bit integer to the underlying writer. Read more
Source§

fn write_u128<T>(&mut self, n: u128) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned 128 bit integer to the underlying writer.
Source§

fn write_i128<T>(&mut self, n: i128) -> Result<(), Error>
where T: ByteOrder,

Writes a signed 128 bit integer to the underlying writer.
Source§

fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
Source§

fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>
where T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
Source§

fn write_f32<T>(&mut self, n: f32) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more
Source§

fn write_f64<T>(&mut self, n: f64) -> Result<(), Error>
where T: ByteOrder,

Writes a IEEE754 double-precision (8 bytes) floating point number to the underlying writer. Read more
Source§

impl<W> Writer for W
where W: Write,

Source§

fn write(&mut self, slice: &[u8]) -> Result<(), Error>

Write the given DER-encoded bytes as output.
Source§

fn write_byte(&mut self, byte: u8) -> Result<(), Error>

Write a single byte.
Source§

impl<W> WriterBackend for W
where W: Write,

Source§

fn pb_write_u8(&mut self, x: u8) -> Result<(), Error>

Write a u8
Source§

fn pb_write_u32(&mut self, x: u32) -> Result<(), Error>

Write a u32
Source§

fn pb_write_i32(&mut self, x: i32) -> Result<(), Error>

Write a i32
Source§

fn pb_write_f32(&mut self, x: f32) -> Result<(), Error>

Write a f32
Source§

fn pb_write_u64(&mut self, x: u64) -> Result<(), Error>

Write a u64
Source§

fn pb_write_i64(&mut self, x: i64) -> Result<(), Error>

Write a i64
Source§

fn pb_write_f64(&mut self, x: f64) -> Result<(), Error>

Write a f64
Source§

fn pb_write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Write all bytes in buf
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneAnySend for T
where T: Any + Send + Clone,

Source§

impl<T> CloneAnySendSync for T
where T: Any + Send + Sync + Clone,

Source§

impl<T> CloneAnySync for T
where T: Any + Sync + Clone,

Source§

impl<S> Codec for S
where S: Decode + Encode,

Source§

impl<T> CustomError for T
where T: Error + Send + Sync + 'static,

Source§

impl<T> CustomError for T
where T: Error + Send + Sync + 'static,

Source§

impl<T> CustomError for T
where T: Error + Send + Sync + 'static,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> EncodeLike<&&T> for T
where T: Encode,

Source§

impl<T> EncodeLike<&T> for T
where T: Encode,

Source§

impl<T> EncodeLike<&mut T> for T
where T: Encode,

Source§

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

Source§

impl<T> EncodeLike<Box<T>> for T
where T: Encode,

Source§

impl<'a, T> EncodeLike<Cow<'a, T>> for T
where T: ToOwned + Encode,

Source§

impl<T> EncodeLike<Rc<T>> for T
where T: Encode,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Error for T
where T: 'static + Debug + Display + Send + Sync,

Source§

impl<T> FindObjectOrHeader for T
where T: Find + Header,

Source§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

Source§

impl<E> FromProtoError for E
where E: From<ProtoError> + Error + Clone,

Source§

impl<S> FullCodec for S
where S: Decode + FullEncode,

Source§

impl<S> FullEncode for S
where S: Encode + EncodeLike,

Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeDebug for T
where T: Debug,

Source§

impl<T> MaybeDisplay for T
where T: Display,

Source§

impl<T> MaybeHash for T
where T: Hash,

Source§

impl<T> MaybeHash for T
where T: Hash,

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T

Source§

impl<T> MaybeSerialize for T
where T: Serialize,

Source§

impl<T> MaybeSerializeDeserialize for T

Source§

impl<T> Member for T
where T: Send + Sync + Debug + Eq + PartialEq + Clone + 'static,

Source§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,

Source§

impl<T> RpcObject for T
where T: RpcParam + RpcReturn,

Source§

impl<T> RpcParam for T
where T: Serialize + Clone + Debug + Send + Sync + Unpin,

Source§

impl<T> RpcReturn for T
where T: DeserializeOwned + Debug + Send + Sync + Unpin + 'static,

Source§

impl<T> SmartSubtransportStream for T
where T: Read + Write + Send + 'static,

Source§

impl<T> StaticTypeInfo for T
where T: TypeInfo + 'static,

Source§

impl<T> ThreadSafeCloneable for T
where T: Clone + Send + Sync + 'static,

Source§

impl<T> TypeId for T
where T: Clone + Debug + Default,