Skip to main content

Config

Trait Config 

Source
pub trait Config: Sized {
    // Required methods
    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>;
    fn to_bytes(&self) -> Result<Vec<u8>, Error>;
    fn record_inspect(&self, inspector_node: &Node);

    // Provided methods
    fn take_from_startup_handle() -> Self { ... }
    fn from_vmo(vmo: &Vmo) -> Result<Self, Error> { ... }
    fn to_vmo(&self) -> Result<Vmo, Error> { ... }
}

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Parse Self from bytes.

Source

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Returns the serialized version of self.

Source

fn record_inspect(&self, inspector_node: &Node)

Record config into inspect node.

Provided Methods§

Source

fn take_from_startup_handle() -> Self

Take the config startup handle and parse its contents.

§Panics

If the config startup handle was already taken or if it is not valid.

Source

fn from_vmo(vmo: &Vmo) -> Result<Self, Error>

Parse Self from vmo.

Source

fn to_vmo(&self) -> Result<Vmo, Error>

Returns a VMO containing the serialized version of self.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§