intuicio_data::data_stack

Struct DataStack

source
pub struct DataStack { /* private fields */ }

Implementations§

source§

impl DataStack

source

pub fn new(capacity: usize, mode: DataStackMode) -> Self

source

pub fn position(&self) -> usize

source

pub fn size(&self) -> usize

source

pub fn available(&self) -> usize

source

pub fn as_bytes(&self) -> &[u8]

source

pub fn visit(&self, f: impl FnMut(TypeHash, Layout, &[u8], Range<usize>, bool))

source

pub fn push<T: Finalize + Sized + 'static>(&mut self, value: T) -> bool

source

pub unsafe fn push_raw( &mut self, layout: Layout, type_hash: TypeHash, finalizer: unsafe fn(_: *mut ()), data: &[u8], ) -> bool

§Safety
source

pub fn push_register<T: Finalize + 'static>(&mut self) -> Option<usize>

source

pub fn push_register_value<T: Finalize + 'static>( &mut self, value: T, ) -> Option<usize>

source

pub unsafe fn push_register_raw( &mut self, type_hash: TypeHash, value_layout: Layout, ) -> Option<usize>

§Safety
source

pub fn push_stack(&mut self, other: Self) -> Result<(), Self>

source

pub fn push_from_register( &mut self, register: &mut DataStackRegisterAccess<'_>, ) -> bool

source

pub fn pop<T: Sized + 'static>(&mut self) -> Option<T>

source

pub unsafe fn pop_raw( &mut self, ) -> Option<(Layout, TypeHash, unsafe fn(_: *mut ()), Vec<u8>)>

§Safety
source

pub fn drop(&mut self) -> bool

source

pub fn drop_register(&mut self) -> bool

source

pub fn pop_stack(&mut self, data_count: usize, capacity: Option<usize>) -> Self

source

pub fn pop_to_register( &mut self, register: &mut DataStackRegisterAccess<'_>, ) -> bool

source

pub fn store(&self) -> DataStackToken

source

pub fn restore(&mut self, token: DataStackToken)

source

pub fn reverse(&mut self, token: DataStackToken)

source

pub fn peek(&self) -> Option<TypeHash>

source

pub fn registers_count(&self) -> usize

source

pub fn access_register( &mut self, index: usize, ) -> Option<DataStackRegisterAccess<'_>>

source

pub fn access_registers_pair( &mut self, a: usize, b: usize, ) -> Option<(DataStackRegisterAccess<'_>, DataStackRegisterAccess<'_>)>

source

pub unsafe fn prevent_drop(&mut self)

§Safety

Trait Implementations§

source§

impl Drop for DataStack

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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> Finalize for T

source§

unsafe fn finalize_raw(data: *mut ())

Safety 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.