lc3_ensemble::asm::encoding

Trait ObjFileFormat

source
pub trait ObjFileFormat {
    type Stream: ToOwned + ?Sized;

    // Required methods
    fn serialize(o: &ObjectFile) -> <Self::Stream as ToOwned>::Owned;
    fn deserialize(i: &Self::Stream) -> Option<ObjectFile>;
}
Expand description

A trait defining object file formats.

Required Associated Types§

source

type Stream: ToOwned + ?Sized

Representation of the serialized format.

For binary formats, [u8] should be used. For text-based formats,str should be used.

Required Methods§

source

fn serialize(o: &ObjectFile) -> <Self::Stream as ToOwned>::Owned

Serializes into the stream format.

source

fn deserialize(i: &Self::Stream) -> Option<ObjectFile>

Deserializes from the stream format, returning None if an error occurred during deserialization.

Object Safety§

This trait is not object safe.

Implementors§