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§
Sourcefn profile(&self) -> &DeviceProfile
fn profile(&self) -> &DeviceProfile
Returns the profile for this session.
Sourcefn start(&mut self) -> DeviceResult<()>
fn start(&mut self) -> DeviceResult<()>
Starts sample or command processing.
Sourcefn poll(&mut self, kind: &str) -> DeviceResult<Option<Expr>>
fn poll(&mut self, kind: &str) -> DeviceResult<Option<Expr>>
Polls one sample expression for kind.
Sourcefn send(&mut self, command: &Expr) -> DeviceResult<()>
fn send(&mut self, command: &Expr) -> DeviceResult<()>
Sends an actuator command expression to the device.
Sourcefn stop(&mut self) -> DeviceResult<()>
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".