Trait rust_dmx::DmxPort [−][src]
pub trait DmxPort: Display + Serialize + Deserialize { fn available_ports() -> Result<Vec<Box<dyn DmxPort>>, Error>
where
Self: Sized; fn open(&mut self) -> Result<(), Error>; fn close(&mut self); fn write(&mut self, frame: &[u8]) -> Result<(), Error>; }
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
fn available_ports() -> Result<Vec<Box<dyn DmxPort>>, Error> where
Self: Sized,
[src]
Self: Sized,
Return the available ports. The ports will need to be opened before use.
fn open(&mut self) -> Result<(), Error>
[src]
Open the port for writing. Implementations should no-op if this is called twice rather than returning an error. Primarily used to re-open a port that has be deserialized.
fn close(&mut self)
[src]
Close the port.
fn write(&mut self, frame: &[u8]) -> Result<(), Error>
[src]
Write a DMX frame out to the port. If the frame is smaller than the minimum universe size, it will be padded with zeros. If the frame is larger than the maximum universe size, the values beyond the max size will be ignored.
Trait Implementations
Implementors
impl DmxPort for EnttecDmxPort
[src]
impl DmxPort for EnttecDmxPort
[src]