Struct Offset

Source
pub struct Offset<'a, P, T> {
    pub position: u64,
    pub data: &'a T,
    pub field_alignment: Option<u64>,
    pub padding_byte: u8,
    /* private fields */
}

Fields§

§position: u64

The position in the file for the offset field.

§data: &'a T

The data pointed to by the offset.

§field_alignment: Option<u64>

Alignment override applied at the field level.

§padding_byte: u8

The byte used for padding or alignment. This is usually 0u8.

Implementations§

Source§

impl<'a, P, T> Offset<'a, P, T>

Source

pub fn new( position: u64, data: &'a T, field_alignment: Option<u64>, padding_byte: u8, ) -> Self

Source

pub fn set_offset<W>( &self, writer: &mut W, offset: u64, endian: Endian, ) -> Xc3Result<()>
where W: Write + Seek, P: TryFrom<u64> + Xc3Write, <P as TryFrom<u64>>::Error: Debug,

Source§

impl<P, T> Offset<'_, P, T>
where T: Xc3Write, P: TryFrom<u64> + Xc3Write, <P as TryFrom<u64>>::Error: Debug,

Source

pub fn write<W: Write + Seek>( &self, writer: &mut W, base_offset: u64, data_ptr: &mut u64, endian: Endian, ) -> Xc3Result<T::Offsets<'_>>

Source§

impl<P, T> Offset<'_, P, T>
where T: Xc3Write + WriteFull, P: TryFrom<u64> + Xc3Write, <P as TryFrom<u64>>::Error: Debug,

Source

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

Trait Implementations§

Source§

impl<P, T: Xc3Write> Debug for Offset<'_, P, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, P, T> Freeze for Offset<'a, P, T>

§

impl<'a, P, T> RefUnwindSafe for Offset<'a, P, T>

§

impl<'a, P, T> Send for Offset<'a, P, T>
where T: Sync, P: Send,

§

impl<'a, P, T> Sync for Offset<'a, P, T>
where T: Sync, P: Sync,

§

impl<'a, P, T> Unpin for Offset<'a, P, T>
where P: Unpin,

§

impl<'a, P, T> UnwindSafe for Offset<'a, P, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.