xc3_write

Trait Xc3Write

Source
pub trait Xc3Write {
    type Offsets<'a>
       where Self: 'a;

    const ALIGNMENT: u64 = 4u64;

    // Required method
    fn xc3_write<W: Write + Seek>(
        &self,
        writer: &mut W,
        endian: Endian,
    ) -> Xc3Result<Self::Offsets<'_>>;

    // Provided method
    fn should_write(&self) -> Option<bool> { ... }
}
Expand description

The write pass that writes fields and placeholder offsets.

Provided Associated Constants§

Source

const ALIGNMENT: u64 = 4u64

The alignment of absolute offsets for this type in bytes.

Required Associated Types§

Source

type Offsets<'a> where Self: 'a

The type storing offset data to be used in Xc3WriteOffsets.

Required Methods§

Source

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Write all fields and placeholder offsets. This should almost always be derived for non primitive types.

Provided Methods§

Source

fn should_write(&self) -> Option<bool>

Return Some(_) if the offset should be updated and Some(true) if the data should also be written. Defaults to Some(true).

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.

Implementations on Foreign Types§

Source§

impl Xc3Write for f32

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for f64

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for i8

Source§

const ALIGNMENT: u64 = 1u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for i16

Source§

const ALIGNMENT: u64 = 2u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for i32

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for i64

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for u8

Source§

const ALIGNMENT: u64 = 1u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for u16

Source§

const ALIGNMENT: u64 = 2u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for u32

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for u64

Source§

const ALIGNMENT: u64 = 4u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for ()

Source§

const ALIGNMENT: u64 = 1u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, _: &mut W, _: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl Xc3Write for String

Source§

const ALIGNMENT: u64 = 1u64

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, _: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl<A: Xc3Write, B: Xc3Write> Xc3Write for (A, B)

Source§

type Offsets<'a> = (<A as Xc3Write>::Offsets<'a>, <B as Xc3Write>::Offsets<'a>) where A: 'a, B: 'a

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl<T> Xc3Write for Option<T>
where T: Xc3Write,

Source§

const ALIGNMENT: u64 = T::ALIGNMENT

Source§

type Offsets<'a> = Option<<T as Xc3Write>::Offsets<'a>> where Self: 'a

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

fn should_write(&self) -> Option<bool>

Source§

impl<T> Xc3Write for Vec<T>
where T: Xc3Write + 'static,

Source§

type Offsets<'a> = VecOffsets<<T as Xc3Write>::Offsets<'a>>

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

fn should_write(&self) -> Option<bool>

Source§

impl<T: Xc3Write> Xc3Write for Box<T>

Source§

type Offsets<'a> = <T as Xc3Write>::Offsets<'a> where Self: 'a

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Source§

impl<const N: usize, T> Xc3Write for [T; N]
where T: Xc3Write + 'static,

Source§

type Offsets<'a> = ()

Source§

fn xc3_write<W: Write + Seek>( &self, writer: &mut W, endian: Endian, ) -> Xc3Result<Self::Offsets<'_>>

Implementors§