Skip to main content

ShapeExt

Trait ShapeExt 

Source
pub trait ShapeExt<This>
where This: ShapeAlg,
{ // Required methods fn bytes_hex(&self, len: Option<usize>) -> This::Ty; fn bytes_array(&self) -> This::Ty; fn int_decimal(&self, signed: bool, bits: u16) -> This::Ty; fn int_hex(&self, signed: bool, bits: u16) -> This::Ty; fn named_product( &self, words: Words<'_>, fields: Vec<This::Field>, ) -> This::Ty; fn sum_untagged<'w>( &self, alternatives: Vec<(Words<'w>, This::Ty)>, ) -> This::Ty; fn sum_of_names<'w>(&self, names: Vec<Words<'w>>) -> This::Ty; }
Expand description

The shape operations that follow from the primitives alone.

Required Methods§

Source

fn bytes_hex(&self, len: Option<usize>) -> This::Ty

Bytes written as hexadecimal.

Source

fn bytes_array(&self) -> This::Ty

Bytes written as an array of JSON numbers, which is a sequence of octets and nothing more.

Source

fn int_decimal(&self, signed: bool, bits: u16) -> This::Ty

An integer written as decimal digits, for a width a JSON number cannot hold.

Source

fn int_hex(&self, signed: bool, bits: u16) -> This::Ty

An integer written as a 0x quantity, as the Ethereum JSON-RPC specification states one.

Source

fn named_product(&self, words: Words<'_>, fields: Vec<This::Field>) -> This::Ty

A named product: the shape most types have.

Source

fn sum_untagged<'w>(&self, alternatives: Vec<(Words<'w>, This::Ty)>) -> This::Ty

A choice written as the alternative’s value alone, with no discriminant on the wire.

Source

fn sum_of_names<'w>(&self, names: Vec<Words<'w>>) -> This::Ty

A choice between names alone, which is a choice between name-valued constants.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<This> ShapeExt<This> for This
where This: ShapeAlg,

The shape operations that follow from the primitives alone.