pub struct FfiBuffer { /* private fields */ }Expand description
An argument or result buffer of an FFI call.
Implementations§
Source§impl FfiBuffer
impl FfiBuffer
Sourcepub fn dtype(&self) -> FfiDataType
pub fn dtype(&self) -> FfiDataType
Returns the element type.
Sourcepub fn as_slice<T: FfiElement>(&self) -> Result<&[T], String>
pub fn as_slice<T: FfiElement>(&self) -> Result<&[T], String>
Views the elements as Ts, in row-major order.
§Errors
Returns an error message if the buffer’s type is not T.
Sourcepub fn as_mut_slice<T: FfiElement>(&mut self) -> Result<&mut [T], String>
pub fn as_mut_slice<T: FfiElement>(&mut self) -> Result<&mut [T], String>
Views the elements as mutable Ts, in row-major order.
§Errors
Returns an error message if the buffer’s type is not T.
Trait Implementations§
Auto Trait Implementations§
impl !Send for FfiBuffer
impl !Sync for FfiBuffer
impl Freeze for FfiBuffer
impl RefUnwindSafe for FfiBuffer
impl Unpin for FfiBuffer
impl UnsafeUnpin for FfiBuffer
impl UnwindSafe for FfiBuffer
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