Skip to main content

GeneratorFunc

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 { ... }
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn size(&self, context: &Context<'_>, args: &[&str]) -> NonZero<U256>

Source

fn write_to( &self, context: &Context<'_>, w: &mut dyn Write, index: &mut dyn ExposeSecretMut<U256>, args: &[&str], ) -> Result<()>

Provided Methods§

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for dyn GeneratorFunc + 'a

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§