[][src]Trait processing::buffer::Content

pub unsafe trait Content {
    type Owned;
    fn read<F, E>(size: usize, F) -> Result<Self::Owned, E>
    where
        F: FnOnce(&mut Self) -> Result<(), E>
;
fn get_elements_size() -> usize;
fn to_void_ptr(&self) -> *const ();
fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut Self>;
fn is_size_suitable(usize) -> bool; }

Trait for types of data that can be put inside buffers.

Associated Types

type Owned

A type that holds a sized version of the content.

Loading content...

Required methods

fn read<F, E>(size: usize, F) -> Result<Self::Owned, E> where
    F: FnOnce(&mut Self) -> Result<(), E>, 

Prepares an output buffer, then turns this buffer into an Owned.

fn get_elements_size() -> usize

Returns the size of each element.

fn to_void_ptr(&self) -> *const ()

Produces a pointer to the data.

fn ref_from_ptr(ptr: *mut (), size: usize) -> Option<*mut Self>

Builds a pointer to this type from a raw pointer.

fn is_size_suitable(usize) -> bool

Returns true if the size is suitable to store a type like this.

Loading content...

Implementations on Foreign Types

impl<T> Content for [T] where
    T: Copy
[src]

type Owned = Vec<T>

Loading content...

Implementors

impl<T> Content for T where
    T: Copy
[src]

type Owned = T

Loading content...