#[repr(C)]
pub struct _ion_collection { pub _owner: *mut c_void, pub _node_size: i32, pub _count: i32, pub _head: *mut ION_COLLECTION_NODE, pub _tail: *mut ION_COLLECTION_NODE, pub _freelist: *mut ION_COLLECTION_NODE, }
Expand description

The collections used by the parser are linked lists which are managed by the collection header. the memory used for the nodes is allocated on the parent, which is passed in when the user initializes the collection

the nodes in the list have a user sized data buffer, which is expected to a small struct (like ion string) or a scaler (like an int or pointer).

the push, pop, and append routines return the address of this data buffer - for push and append it is the buffer of the new node for pop it is the buffer of the released node - which is still allocated and is, therefore, good UNTIL ANOTHER push or append or copy is executed against the containing collection.

each collections holds a high water mark free list of nodes that were previously used but aren’t currently being used

to use this as a: queue you’ll want to “append” and “pop head” stack you’ll want to “push” and “pop head”

Fields§

§_owner: *mut c_void§_node_size: i32§_count: i32§_head: *mut ION_COLLECTION_NODE§_tail: *mut ION_COLLECTION_NODE§_freelist: *mut ION_COLLECTION_NODE

Trait Implementations§

source§

impl Clone for _ion_collection

source§

fn clone(&self) -> _ion_collection

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for _ion_collection

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for _ion_collection

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for _ion_collection

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.