Skip to main content

Fixture

Struct Fixture 

Source
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

Source

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 registered FixtureType
  • start_channel - DMX-Channel offset within the universe
  • universe - DMX universe index (0-based)
  • name - Unique name for this fixture instance
§Errors
Source

pub fn iter_over_properties( &self, ) -> impl Iterator<Item = (PropertyType, &Channel)>

Returns an iterator over all properties and their channels.

Source

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 index
  • new_universe - New target DMX universe index (0-based)
§Errors
Source

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
Source

pub fn get_fixture_type(&self) -> String

Returns the name of the FixtureType this fixture was created from.

Source

pub fn get_name(&self) -> &str

Returns the name of this fixture.

Trait Implementations§

Source§

impl Clone for Fixture

Source§

fn clone(&self) -> Fixture

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.