Struct metatensor::c_api::mts_array_t
source · #[repr(C)]pub struct mts_array_t {
pub ptr: *mut c_void,
pub origin: Option<unsafe extern "C" fn(array: *const c_void, origin: *mut mts_data_origin_t) -> mts_status_t>,
pub data: Option<unsafe extern "C" fn(array: *mut c_void, data: *mut *mut f64) -> mts_status_t>,
pub shape: Option<unsafe extern "C" fn(array: *const c_void, shape: *mut *const usize, shape_count: *mut usize) -> mts_status_t>,
pub reshape: Option<unsafe extern "C" fn(array: *mut c_void, shape: *const usize, shape_count: usize) -> mts_status_t>,
pub swap_axes: Option<unsafe extern "C" fn(array: *mut c_void, axis_1: usize, axis_2: usize) -> mts_status_t>,
pub create: Option<unsafe extern "C" fn(array: *const c_void, shape: *const usize, shape_count: usize, new_array: *mut mts_array_t) -> mts_status_t>,
pub copy: Option<unsafe extern "C" fn(array: *const c_void, new_array: *mut mts_array_t) -> mts_status_t>,
pub destroy: Option<unsafe extern "C" fn(array: *mut c_void)>,
pub move_samples_from: Option<unsafe extern "C" fn(output: *mut c_void, input: *const c_void, samples: *const mts_sample_mapping_t, samples_count: usize, property_start: usize, property_end: usize) -> mts_status_t>,
}
Fields§
§ptr: *mut c_void
§origin: Option<unsafe extern "C" fn(array: *const c_void, origin: *mut mts_data_origin_t) -> mts_status_t>
§data: Option<unsafe extern "C" fn(array: *mut c_void, data: *mut *mut f64) -> mts_status_t>
§shape: Option<unsafe extern "C" fn(array: *const c_void, shape: *mut *const usize, shape_count: *mut usize) -> mts_status_t>
§reshape: Option<unsafe extern "C" fn(array: *mut c_void, shape: *const usize, shape_count: usize) -> mts_status_t>
§swap_axes: Option<unsafe extern "C" fn(array: *mut c_void, axis_1: usize, axis_2: usize) -> mts_status_t>
§create: Option<unsafe extern "C" fn(array: *const c_void, shape: *const usize, shape_count: usize, new_array: *mut mts_array_t) -> mts_status_t>
§copy: Option<unsafe extern "C" fn(array: *const c_void, new_array: *mut mts_array_t) -> mts_status_t>
§destroy: Option<unsafe extern "C" fn(array: *mut c_void)>
§move_samples_from: Option<unsafe extern "C" fn(output: *mut c_void, input: *const c_void, samples: *const mts_sample_mapping_t, samples_count: usize, property_start: usize, property_end: usize) -> mts_status_t>
Implementations§
source§impl mts_array_t
impl mts_array_t
sourcepub fn null() -> mts_array_t
pub fn null() -> mts_array_t
Create an mts_array_t
with all members set to null pointers/None
sourcepub fn origin(&self) -> Result<mts_data_origin_t, Error>
pub fn origin(&self) -> Result<mts_data_origin_t, Error>
call mts_array_t.origin
with a more convenient API
sourcepub fn shape(&self) -> Result<&[usize], Error>
pub fn shape(&self) -> Result<&[usize], Error>
call mts_array_t.shape
with a more convenient API
sourcepub fn data(&mut self) -> Result<&mut [f64], Error>
pub fn data(&mut self) -> Result<&mut [f64], Error>
call mts_array_t.data
with a more convenient API
sourcepub fn reshape(&mut self, shape: &[usize]) -> Result<(), Error>
pub fn reshape(&mut self, shape: &[usize]) -> Result<(), Error>
call mts_array_t.reshape
with a more convenient API
sourcepub fn swap_axes(&mut self, axis_1: usize, axis_2: usize) -> Result<(), Error>
pub fn swap_axes(&mut self, axis_1: usize, axis_2: usize) -> Result<(), Error>
call mts_array_t.swap_axes
with a more convenient API
sourcepub fn create(&self, shape: &[usize]) -> Result<mts_array_t, Error>
pub fn create(&self, shape: &[usize]) -> Result<mts_array_t, Error>
call mts_array_t.create
with a more convenient API
sourcepub fn move_samples_from(
&mut self,
input: &mts_array_t,
samples: &[mts_sample_mapping_t],
properties: Range<usize>
) -> Result<(), Error>
pub fn move_samples_from( &mut self, input: &mts_array_t, samples: &[mts_sample_mapping_t], properties: Range<usize> ) -> Result<(), Error>
call mts_array_t.move_samples_from
with a more convenient API
Trait Implementations§
source§impl Clone for mts_array_t
impl Clone for mts_array_t
source§fn clone(&self) -> mts_array_t
fn clone(&self) -> mts_array_t
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for mts_array_t
impl Debug for mts_array_t
impl Copy for mts_array_t
Auto Trait Implementations§
impl RefUnwindSafe for mts_array_t
impl !Send for mts_array_t
impl !Sync for mts_array_t
impl Unpin for mts_array_t
impl UnwindSafe for mts_array_t
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more