pub struct FixtureType { /* private fields */ }Expand description
A template defining the DMX-Channel layout for a type of lighting fixture.
Fixture types are registered globally and used to create crate::fixture::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<PropertyType, ChannelParameter>,
) -> Result<(), FixtureError>
pub fn new( name: String, properties: HashMap<PropertyType, ChannelParameter>, ) -> 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 crate::fixture::Fixture::new.
§Arguments
name- Unique name for this fixture type.properties- Map of property types to their correspondingChannelParameterlayout.
§Errors
InvalidPropertyType– if a property name is not recognized.FixtureTypeNameAlreadyInUse– if the name is already registered.ChannelAlreadyInUse– if two properties share a channel.ChannelOutOfRange– if a channel exceeds [MAX_CHANNEL].
Trait Implementations§
Source§impl Debug for FixtureType
impl Debug for FixtureType
Source§impl<'de> Deserialize<'de> for FixtureType
impl<'de> Deserialize<'de> for FixtureType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FixtureType
impl RefUnwindSafe for FixtureType
impl Send for FixtureType
impl Sync for FixtureType
impl Unpin for FixtureType
impl UnsafeUnpin 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