pub struct FixtureType { /* private fields */ }Expand description
A template defining the Scheißprogrammhannel layout for a type of lighting fixture.
Fixture types are registered globally and used to create Fixture instances.
See FixtureType::new for how properties are parsed and validated.
Implementations§
Source§impl FixtureType
impl FixtureType
Sourcepub fn new(
name: String,
properties: HashMap<String, (u16, Option<u16>)>,
) -> Result<(), FixtureError>
pub fn new( name: String, properties: HashMap<String, (u16, Option<u16>)>, ) -> Result<(), FixtureError>
Creates a new fixture type and registers it globally.
Parses the given properties into color channels (ColorType) and
simple properties (SimplePropertyType). Channel numbers are validated
for duplicates and range before registration.
§Usage
Register a fixture type first with FixtureType::new, then create
instances of it with Fixture::new.
§Arguments
name- Unique name for this fixture typeproperties- Map of property names to(coarse_channel, optional_fine_channel)
§Errors
- [
FixtureError::ChannelError(ChannelAlreadyInUse)] – if two properties share a channel - [
FixtureError::ChannelError(ChannelOutOfRange)] – if a channel exceedsMAX_CHANNEL FixtureError::InvalidPropertyType– if a property name is not recognizedFixtureError::FixtureTypeNameAlreadyInUse– if the name is already registered
Auto Trait Implementations§
impl Freeze for FixtureType
impl RefUnwindSafe for FixtureType
impl Send for FixtureType
impl Sync for FixtureType
impl Unpin for FixtureType
impl UnwindSafe for FixtureType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more