Trait tantivy_common::BinarySerializable

source ·
pub trait BinarySerializable: Debug + Sized {
    // Required methods
    fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>;
    fn deserialize<R: Read>(reader: &mut R) -> Result<Self>;

    // Provided method
    fn num_bytes(&self) -> u64 { ... }
}
Expand description

Trait for a simple binary serialization.

Required Methods§

source

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

Serialize

source

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

Deserialize

Provided Methods§

source

fn num_bytes(&self) -> u64

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BinarySerializable for bool

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<bool>

source§

impl BinarySerializable for f32

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl BinarySerializable for f64

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl BinarySerializable for i64

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl BinarySerializable for u8

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<u8>

source§

impl BinarySerializable for u16

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<u16>

source§

impl BinarySerializable for u32

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<u32>

source§

impl BinarySerializable for u64

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl BinarySerializable for u128

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl BinarySerializable for ()

source§

fn serialize<W: Write + ?Sized>(&self, _: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(_: &mut R) -> Result<Self>

source§

impl BinarySerializable for String

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<String>

source§

impl<'a> BinarySerializable for Cow<'a, str>

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Cow<'a, str>>

source§

impl<'a> BinarySerializable for Cow<'a, [u8]>

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Cow<'a, [u8]>>

source§

impl<Left: BinarySerializable, Right: BinarySerializable> BinarySerializable for (Left, Right)

source§

fn serialize<W: Write + ?Sized>(&self, write: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Self>

source§

impl<T: BinarySerializable> BinarySerializable for Vec<T>

source§

fn serialize<W: Write + ?Sized>(&self, writer: &mut W) -> Result<()>

source§

fn deserialize<R: Read>(reader: &mut R) -> Result<Vec<T>>

Implementors§