[][src]Struct c_bridge::GenericArray

#[repr(transparent)]
pub struct GenericArray<T: 'static>(_, _);

An interface to work with FfiObjects containing an array

Important: You should not specialize this trait by yourself; use the predefined types instead (DataArray and ObjectArray)

Methods

impl<T: 'static> GenericArray<T>[src]

pub fn as_slice(&self) -> &[T][src]

The underlying elements as slice

pub fn as_slice_mut(&mut self) -> &mut [T][src]

The underlying elements as mutable slice

pub fn move_into_vec(self) -> Result<Vec<T>, Self>[src]

Moves the underlying memory from the array-payload out of the underlying FfiObject and creates a Vec<_> from it

Note: this only works if the array was created using from_vec

Trait Implementations

impl<T: 'static> From<GenericArray<T>> for FfiObject[src]

impl From<Vec<u8>> for GenericArray<u8>[src]

fn from(vec: Vec<u8>) -> Self[src]

Creates a new array from vec and wraps it into a wrapped and owned FfiObject

impl From<Vec<FfiObject>> for GenericArray<FfiObject>[src]

fn from(vec: Vec<FfiObject>) -> Self[src]

Creates a new array from vec and wraps it into a wrapped and owned FfiObject

impl<T: 'static> TryFrom<FfiObject> for GenericArray<T>[src]

type Error = FfiObject

The type returned in the event of a conversion error.

fn try_from(object: FfiObject) -> Result<Self, Self::Error>[src]

Converts object into the array if it has the correct type and is not empty

Auto Trait Implementations

impl<T> !Send for GenericArray<T>

impl<T> Unpin for GenericArray<T> where
    T: Unpin

impl<T> !Sync for GenericArray<T>

impl<T> RefUnwindSafe for GenericArray<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for GenericArray<T> where
    T: UnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]