Skip to main content

DeviceSample

Trait DeviceSample 

Source
pub trait DeviceSample: Sized {
    // Required methods
    fn sample_kind() -> &'static str;
    fn to_expr(&self) -> Expr;
    fn from_expr(expr: &Expr) -> DeviceResult<Self>;
}
Expand description

Device sample expression contract used by session polling helpers.

Required Methods§

Source

fn sample_kind() -> &'static str

Stable bare sample kind, such as device-caps.

Source

fn to_expr(&self) -> Expr

Encodes the sample as a self-describing expression.

Source

fn from_expr(expr: &Expr) -> DeviceResult<Self>

Decodes the sample from its expression form.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§