Skip to main content

Actuator

Trait Actuator 

Source
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§

Source

type Command

The command accepted by a single application, for example a setpoint.

Required Methods§

Source

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".

Implementors§