Skip to main content

Sample

Trait Sample 

Source
pub trait Sample:
    Copy
    + Default
    + Sealed
    + 'static {
    // Required methods
    fn data_type() -> DataType;
    fn from_f64(value: f64) -> Self;
    fn to_f64(self) -> f64;
    fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>;
    fn into_pixel_data(values: Vec<Self>) -> PixelData;
    fn append_le_bytes(self, out: &mut Vec<u8>);
}

Required Methods§

Source

fn data_type() -> DataType

Source

fn from_f64(value: f64) -> Self

Source

fn to_f64(self) -> f64

Source

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source

fn append_le_bytes(self, out: &mut Vec<u8>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Sample for f32

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for f64

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for i8

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for i16

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for i32

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for u8

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for u16

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Source§

impl Sample for u32

Source§

fn data_type() -> DataType

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(self) -> f64

Source§

fn read_vec(bytes: &[u8]) -> Result<Vec<Self>>

Source§

fn into_pixel_data(values: Vec<Self>) -> PixelData

Source§

fn append_le_bytes(self, out: &mut Vec<u8>)

Implementors§