Trait vector_buffers::encoding::AsMetadata

source ·
pub trait AsMetadata: Sized {
    // Required methods
    fn into_u32(self) -> u32;
    fn from_u32(value: u32) -> Option<Self>;
}
Expand description

Converts back and forth between user-friendly metadata types and the on-disk integer representation.

Required Methods§

source

fn into_u32(self) -> u32

Converts this metadata value into its integer representation.

source

fn from_u32(value: u32) -> Option<Self>

Converts an integer representation of metadata into its real type, if possible.

If the given integer does not represent a valid representation of the given metadata type, possibly due to including bits not valid for the type, and so on, then None will be returned. Otherwise, Some(Self) will be returned.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsMetadata for ()

source§

fn into_u32(self) -> u32

source§

fn from_u32(_: u32) -> Option<Self>

Implementors§