pub trait DmxPort: Display + Serialize + Deserialize {
// Required methods
fn available_ports() -> Result<Vec<Box<dyn DmxPort>>>
where Self: Sized;
fn open(&mut self) -> Result<(), OpenError>;
fn close(&mut self);
fn write(&mut self, frame: &[u8]) -> Result<(), WriteError>;
}
Expand description
Trait for the general notion of a DMX port. This enables creation of an “offline” port to slot into place if an API requires an output.
Required Methods§
sourcefn available_ports() -> Result<Vec<Box<dyn DmxPort>>>where
Self: Sized,
fn available_ports() -> Result<Vec<Box<dyn DmxPort>>>where
Self: Sized,
Return the available ports. The ports will need to be opened before use.