HasTypedMemoryCost

Trait HasTypedMemoryCost 

Source
pub trait HasTypedMemoryCost<T>: Sized {
    // Required method
    fn typed_memory_cost(&self, _: EnabledToken) -> TypedMemoryCost<T>;
}
Expand description

Types that can return a memory cost known to be the cost of some value of type T

TypedParticipation::claim and release take arguments implementing this trait.

Implemented by:

  • T: HasMemoryCost (the usual case)
  • HasTypedMemoryCost<T> (memory cost, calculated earlier, from a T)

§Guarantees

This trait has the same guarantees as HasMemoryCost. Normally, it will not be necessary to add an implementation.

Required Methods§

Source

fn typed_memory_cost(&self, _: EnabledToken) -> TypedMemoryCost<T>

The cost, as a TypedMemoryCost<T> rather than a raw usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§