Skip to main content

DeviceSession

Trait DeviceSession 

Source
pub trait DeviceSession: Send {
    // Required methods
    fn profile(&self) -> &DeviceProfile;
    fn start(&mut self) -> DeviceResult<()>;
    fn poll(&mut self, kind: &str) -> DeviceResult<Option<Expr>>;
    fn send(&mut self, command: &Expr) -> DeviceResult<()>;
    fn stop(&mut self) -> DeviceResult<()>;
}
Expand description

Open stream-device session.

Required Methods§

Source

fn profile(&self) -> &DeviceProfile

Returns the profile for this session.

Source

fn start(&mut self) -> DeviceResult<()>

Starts sample or command processing.

Source

fn poll(&mut self, kind: &str) -> DeviceResult<Option<Expr>>

Polls one sample expression for kind.

Source

fn send(&mut self, command: &Expr) -> DeviceResult<()>

Sends an actuator command expression to the device.

Source

fn stop(&mut self) -> DeviceResult<()>

Stops sample or command processing and releases session resources.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§