Trait ByteSize

Source
pub trait ByteSize {
    // Required method
    fn byte_size() -> Bytes;
}
Expand description

A trait defining the size, in bytes, of one unit of Self.

§Example

println!("The size of one word in bytes is {}.", Words::byte_size().0);

Required Methods§

Source

fn byte_size() -> Bytes

The size, in bytes, of a single unit of Self.

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.

Implementors§

Source§

impl ByteSize for memory_units::target::Pages

Source§

impl ByteSize for memory_units::target::Words

Source§

impl ByteSize for Bytes

Source§

impl ByteSize for metered_wasmi::memory_units::Pages

Source§

impl ByteSize for metered_wasmi::memory_units::Words