pub struct MemoryArrayWriter<T> {
    pub position: MDRVA,
    /* private fields */
}

Fields§

§position: MDRVA

Implementations§

source§

impl<T> MemoryArrayWriter<T>
where T: TryIntoCtx<Endian, Error = Error> + SizeWith<Endian> + Copy,

source

pub fn alloc_from_array( buffer: &mut Buffer, array: &[T] ) -> Result<Self, MemoryWriterError>

source§

impl<T> MemoryArrayWriter<T>
where T: TryIntoCtx<Endian, Error = Error> + SizeWith<Endian>,

source

pub fn alloc_from_iter<I>( buffer: &mut Buffer, iter: impl IntoIterator<Item = T, IntoIter = I> ) -> Result<Self, MemoryWriterError>
where I: ExactSizeIterator<Item = T>,

Create a slot for a type T in the buffer, we can fill in the values in one go.

source

pub fn alloc_array( buffer: &mut Buffer, array_size: usize ) -> Result<Self, MemoryWriterError>

Create a slot for a type T in the buffer, we can fill later with real values. This function fills it with Default::default(), which is less performant than using uninitialized memory, but safe.

source

pub fn set_value_at( &mut self, buffer: &mut Buffer, val: T, index: usize ) -> Result<(), MemoryWriterError>

Write actual values in the buffer-slot we got during alloc()

source

pub fn location(&self) -> MDLocationDescriptor

source

pub fn location_of_index(&self, idx: usize) -> MDLocationDescriptor

Trait Implementations§

source§

impl<T: Debug> Debug for MemoryArrayWriter<T>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for MemoryArrayWriter<T>

§

impl<T> RefUnwindSafe for MemoryArrayWriter<T>
where T: RefUnwindSafe,

§

impl<T> Send for MemoryArrayWriter<T>
where T: Send,

§

impl<T> Sync for MemoryArrayWriter<T>
where T: Sync,

§

impl<T> Unpin for MemoryArrayWriter<T>
where T: Unpin,

§

impl<T> UnwindSafe for MemoryArrayWriter<T>
where T: UnwindSafe,

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>,

§

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>,

§

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.