pub struct Cell<T: CellItem> { /* private fields */ }lock only.Expand description
A CSPICE cell holding elements of type T.
The backing storage is owned, and released when the cell is dropped.
Implementations§
Source§impl<T: CellItem> Cell<T>
impl<T: CellItem> Cell<T>
Sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Allocate a cell able to hold size elements.
Character cells get slots of CELL_MAX_LEN bytes; use Cell::with_length to choose.
Sourcepub fn with_length(size: usize, length: usize) -> Self
pub fn with_length(size: usize, length: usize) -> Self
Allocate a cell able to hold size elements whose slots are length items long.
length is only meaningful for character cells, where it is the maximum length of an element.
Sourcepub fn get(&self, index: usize) -> Option<T>
pub fn get(&self, index: usize) -> Option<T>
The element at index, or None past the cardinality.
Sourcepub fn as_ptr(&self) -> *const SpiceCell
pub fn as_ptr(&self) -> *const SpiceCell
The cell descriptor, for calls to the unsafe C API.
Sourcepub fn as_mut_ptr(&mut self) -> *mut SpiceCell
pub fn as_mut_ptr(&mut self) -> *mut SpiceCell
The cell descriptor, for calls to the unsafe C API.
The base and data pointers are refreshed from the backing buffer on every call, so the
descriptor handed out is always the one CSPICE should write through.
Source§impl Cell<i32>
impl Cell<i32>
Sourcepub fn get_data_int(&self, index: usize) -> i32
pub fn get_data_int(&self, index: usize) -> i32
The element at index, or 0 past the cardinality.
Sourcepub fn get_data_bool(&self, index: usize) -> i32
pub fn get_data_bool(&self, index: usize) -> i32
The element at index as a boolean flag, or 0 past the cardinality.
Trait Implementations§
Source§impl<T: CellItem> Deref for Cell<T>
Read only access to the raw descriptor, for the card and size fields CSPICE maintains.
impl<T: CellItem> Deref for Cell<T>
Read only access to the raw descriptor, for the card and size fields CSPICE maintains.
impl<T: CellItem + Send> Send for Cell<T>
Source§impl<'a, T: CellItem> SpiceArg for &'a mut Cell<T>
A pointer to a cell, for the wrappers that take one as an input.
impl<'a, T: CellItem> SpiceArg for &'a mut Cell<T>
A pointer to a cell, for the wrappers that take one as an input.