pub trait AnnotatedValue<Env, T>: Sizedwhere
Env: TxEnv,{
// Required methods
fn annotation(&self, env: &Env) -> ManagedBuffer<Env::Api>;
fn to_value(&self, env: &Env) -> T;
// Provided methods
fn into_value(self, env: &Env) -> T { ... }
fn with_value_ref<F, R>(&self, env: &Env, f: F) -> R
where F: FnOnce(&T) -> R { ... }
}
Expand description
Describes a value can also have a custom representation in a mandos scenario.
It is based on managed types in order to be embedded into parametric tests too.
Required Methods§
fn annotation(&self, env: &Env) -> ManagedBuffer<Env::Api>
Provided Methods§
Sourcefn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Consumes annotated value to produce actual value.
Override whenever it helps to avoid an unnecessary clone.
Sourcefn with_value_ref<F, R>(&self, env: &Env, f: F) -> R
fn with_value_ref<F, R>(&self, env: &Env, f: F) -> R
Can be used when working with references only.
Override whenever it helps to avoid an unnecessary clone.
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.