pub trait ObservationSession: Send {
// Required methods
fn profile(&self) -> &DeviceProfile;
fn start(&mut self) -> DeviceResult<()>;
fn poll(&mut self, kind: &str) -> DeviceResult<Option<Expr>>;
fn stop(&mut self) -> DeviceResult<()>;
}Expand description
Open read-only stream-device session.
This trait deliberately has no downcast hook and no generic command method. A caller holding this object can only observe and release the device.
ⓘ
fn hostile_caller(session: &mut dyn ObservationSession, request: EffectRequest) {
session.invoke(request); // observation authority has no invocation escape
}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 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 stop(&mut self) -> DeviceResult<()>
fn stop(&mut self) -> DeviceResult<()>
Stops sample processing and releases session resources.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".