Trait Xc3WriteOffsets

Source
pub trait Xc3WriteOffsets {
    type Args;

    // Required method
    fn write_offsets<W: Write + Seek>(
        &self,
        writer: &mut W,
        base_offset: u64,
        data_ptr: &mut u64,
        endian: Endian,
        args: Self::Args,
    ) -> Xc3Result<()>;
}
Expand description

The layout pass that updates and writes data for all fields in Xc3Write::Offsets recursively.

Required Associated Types§

Required Methods§

Source

fn write_offsets<W: Write + Seek>( &self, writer: &mut W, base_offset: u64, data_ptr: &mut u64, endian: Endian, args: Self::Args, ) -> Xc3Result<()>

Update and write pointed to data for all fields in Xc3Write::Offsets.

The goal is to call Offset::write or Xc3WriteOffsets::write_offsets in increasing order by absolute offset stored in data_ptr. For writing in order by field recursively, simply derive Xc3WriteOffsets. Manually implementing this trait allows flexibility for cases like placing strings for all types at the end of the file.

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 Xc3WriteOffsets for ()

Source§

type Args = ()

Source§

fn write_offsets<W: Write + Seek>( &self, _: &mut W, _: u64, _: &mut u64, _: Endian, _: Self::Args, ) -> Xc3Result<()>

Source§

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

Source§

type Args = ()

Source§

fn write_offsets<W: Write + Seek>( &self, _: &mut W, _: u64, _: &mut u64, _: Endian, _: (), ) -> Xc3Result<()>

Source§

impl<T, A> Xc3WriteOffsets for Option<T>
where T: Xc3WriteOffsets<Args = A>,

Source§

type Args = A

Source§

fn write_offsets<W: Write + Seek>( &self, writer: &mut W, base_offset: u64, data_ptr: &mut u64, endian: Endian, args: Self::Args, ) -> Xc3Result<()>

Implementors§

Source§

impl<T, A> Xc3WriteOffsets for VecOffsets<T>
where T: Xc3WriteOffsets<Args = A>, A: Clone,

Source§

type Args = A