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 aT
)
§Guarantees
This trait has the same guarantees as HasMemoryCost
.
Normally, it will not be necessary to add an implementation.
Required Methods§
Sourcefn typed_memory_cost(&self, _: EnabledToken) -> TypedMemoryCost<T>
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.