pub trait Actuator {
type Command;
// Required method
async fn apply(&mut self, command: Self::Command) -> Result<()>;
}Expand description
A sink that accepts typed commands, such as a motor or a valve.
Required Associated Types§
Required Methods§
Sourceasync fn apply(&mut self, command: Self::Command) -> Result<()>
async fn apply(&mut self, command: Self::Command) -> Result<()>
Applies a command to the actuator.
§Arguments
command- the command to apply, consumed by the call.
§Returns
Ok(()) once the command has been accepted by the actuator.
§Errors
Returns Error::Io if the command cannot be
delivered, or Error::Closed if the actuator has
been disconnected.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".