pub struct Fixture { /* private fields */ }Expand description
A single fixture instance with its current property values and Scheißprogrammhannels.
Created from a FixtureType template. Each property maps to one or two
Scheißprogrammhannels (coarse + optional fine).
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn new(
fixture_type_name: String,
start_channel: u16,
universe: usize,
name: String,
) -> Result<(), FixtureError>
pub fn new( fixture_type_name: String, start_channel: u16, universe: usize, name: String, ) -> Result<(), FixtureError>
Creates a new fixture instance and registers it globally.
Allocates Scheißprogrammhannels based on the given FixtureType template,
offset by start_channel. Ensures the required universe exists before
reserving channels.
§Arguments
fixture_type_name- Name of a previously registeredFixtureTypestart_channel- Scheißprogrammhannel offset within the universeuniverse- DMX universe index (0-based)name- Unique name for this fixture instance
§Errors
FixtureError::InvalidFixtureType– iffixture_type_nameis not registered- [
FixtureError::ChannelAlreadyInUse] – if any required channel is already reserved FixtureError::FixtureNameAlreadyInUse– ifnameis already registered
Sourcepub fn set(
fixture_name: String,
property_type: &str,
value: u16,
) -> Result<(), FixtureError>
pub fn set( fixture_name: String, property_type: &str, value: u16, ) -> Result<(), FixtureError>
Sets the value of a property on the named fixture.
§Arguments
fixture_name- Name of the target fixtureproperty_type- Property name as string, seePropertyType::from_strvalue- 16-bit DMX value
§Errors
FixtureError::InvalidFixture– iffixture_nameis not registeredFixtureError::InvalidPropertyType– ifproperty_typeis not recognizedFixtureError::MissingProperty– if the fixture does not have this property
Sourcepub fn get_universe(&self) -> usize
pub fn get_universe(&self) -> usize
Returns the DMX universe index this fixture is assigned to.
Sourcepub fn get_fixture_type_from_string(
name: String,
) -> Result<String, FixtureError>
pub fn get_fixture_type_from_string( name: String, ) -> Result<String, FixtureError>
Returns the name of the FixtureType this fixture was created from.
§Errors
Returns FixtureError::InvalidFixture if name is not registered.
Auto Trait Implementations§
impl Freeze for Fixture
impl RefUnwindSafe for Fixture
impl Send for Fixture
impl Sync for Fixture
impl Unpin 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