Trait GeneratorFunc
Source pub trait GeneratorFunc: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn size(&self, context: &Context<'_>, args: &[&str]) -> NonZero<U256>;
fn write_to(
&self,
context: &Context<'_>,
w: &mut dyn Write,
index: &mut dyn ExposeSecretMut<U256>,
args: &[&str],
) -> Result<()>;
// Provided method
fn write_repr(
&self,
_: &Context<'_>,
w: &mut dyn Write,
args: &[&str],
) -> Result { ... }
}
GeneratorFuncs know how to format themselves, which they may use to e.g. inject
dictionary hashes for canonical serialization.
Formats the value using the given formatter.
Read more