Trait extsort_lily::Sortable

source ·
pub trait Sortable<W: Write, R: Read>: Ord + Sized {
    type Error;

    // Required methods
    fn serialize(&self, w: &mut W) -> Result<(), Self::Error>;
    fn deserialize(r: &mut R) -> Option<Result<Self, Self::Error>>;
}
Expand description

Implement this trait for data to be sorted

Required Associated Types§

source

type Error

Errors that may occur during serialization and deserialization. Note that it needs to implement From<std::io::Error>.

Required Methods§

source

fn serialize(&self, w: &mut W) -> Result<(), Self::Error>

serialize itself and write into the writer.

source

fn deserialize(r: &mut R) -> Option<Result<Self, Self::Error>>

read data and deserialize.

If no more items to be read, return None.

Object Safety§

This trait is not object safe.

Implementors§