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§
Required Associated Types§
Sourcetype Offsets<'a>
where
Self: 'a
type Offsets<'a> where Self: 'a
The type storing offset data to be used in Xc3WriteOffsets.
Required Methods§
Sourcefn xc3_write<W: Write + Seek>(
&self,
writer: &mut W,
endian: Endian,
) -> Xc3Result<Self::Offsets<'_>>
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.
An object’s size is defined as the difference between the writer position before and after the first pass and does not need to be user defined. Custom implementations of Xc3Write should ensure the write head points after the data when the function returns to ensure correct size calculations.
Provided Methods§
Sourcefn should_write(&self) -> Option<bool>
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.