Skip to main content

SerializableSemiring

Trait SerializableSemiring 

Source
pub trait SerializableSemiring: Semiring + Display {
    // Required methods
    fn weight_type() -> String;
    fn parse_binary(i: &[u8]) -> IResult<&[u8], Self, NomCustomError<&[u8]>>;
    fn write_binary<F: Write>(&self, file: &mut F) -> Result<()>;
    fn parse_text(i: &str) -> IResult<&str, Self>;

    // Provided method
    fn write_text<F: Write>(&self, file: &mut F) -> Result<()> { ... }
}

Required Methods§

Source

fn weight_type() -> String

Source

fn parse_binary(i: &[u8]) -> IResult<&[u8], Self, NomCustomError<&[u8]>>

Source

fn write_binary<F: Write>(&self, file: &mut F) -> Result<()>

Source

fn parse_text(i: &str) -> IResult<&str, Self>

Provided Methods§

Source

fn write_text<F: Write>(&self, file: &mut F) -> Result<()>

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§