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.