pub struct Fixture { /* private fields */ }Expand description
A single fixture instance with its current property values and DMX-Channels.
Created from a FixtureType template. Each property maps to one or more
DMX-Channels based on its configured ChannelParameter layout.
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn new(
fixture_type_name: String,
start_channel: ChannelIndex,
universe: usize,
name: String,
) -> Result<Fixture, FixtureError>
pub fn new( fixture_type_name: String, start_channel: ChannelIndex, universe: usize, name: String, ) -> Result<Fixture, FixtureError>
Creates a new fixture instance.
Allocates DMX-Channels based on the given FixtureType template,
offset by start_channel, and returns the instantiated Fixture.
§Arguments
fixture_type_name- Name of a previously registeredFixtureTypestart_channel- DMX-Channel offset within the universeuniverse- DMX universe index (0-based)name- Unique name for this fixture instance
§Errors
InvalidFixtureType– iffixture_type_nameis not registered
Sourcepub fn iter_over_properties(
&self,
) -> impl Iterator<Item = (PropertyType, &Channel)>
pub fn iter_over_properties( &self, ) -> impl Iterator<Item = (PropertyType, &Channel)>
Returns an iterator over all properties and their channels.
Sourcepub fn move_to_channel(
&mut self,
new_channel: ChannelIndex,
new_universe: usize,
) -> Result<(), FixtureError>
pub fn move_to_channel( &mut self, new_channel: ChannelIndex, new_universe: usize, ) -> Result<(), FixtureError>
Moves the fixture to a new starting channel and universe.
§Arguments
new_channel- New starting DMX-Channel indexnew_universe- New target DMX universe index (0-based)
§Errors
ChannelOutOfRange– if the new channel range is out of bounds
Sourcepub fn set(
&mut self,
property_type: PropertyType,
value: ChannelValue,
) -> Result<(), FixtureError>
pub fn set( &mut self, property_type: PropertyType, value: ChannelValue, ) -> Result<(), FixtureError>
Sets the value of a property on the fixture.
§Arguments
property_type- Property type to update (Simple or Color)value- 32-bit channel value to set
§Errors
FixtureError::MissingProperty– if the fixture does not have this property
Sourcepub fn get_fixture_type(&self) -> String
pub fn get_fixture_type(&self) -> String
Returns the name of the FixtureType this fixture was created from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fixture
impl RefUnwindSafe for Fixture
impl Send for Fixture
impl Sync for Fixture
impl Unpin for Fixture
impl UnsafeUnpin for Fixture
impl UnwindSafe for Fixture
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