pub struct ChannelParameter { /* private fields */ }Expand description
Represents a DMX-Channel parameter, managing the base channel and its fine-degree channels.
It uses an ArrayVec to store the coarse channel alongside optional fine channels up to MAX_FINE_DEGREES.
Implementations§
Source§impl ChannelParameter
impl ChannelParameter
Sourcepub fn new(channel_index: ChannelIndex, universe_index: UniverseIndex) -> Self
pub fn new(channel_index: ChannelIndex, universe_index: UniverseIndex) -> Self
Initializes a new ChannelParameter with a single, coarse channel index.
§Arguments
channel_index- The base (coarse) channel index to initialize the parameter with.universe_index- The base (coarse) universe index to initialize the parameter with.
Sourcepub fn add_fine(
&mut self,
fine_degree: usize,
fine_channel_index: ChannelIndex,
fine_universe_index: UniverseIndex,
) -> Result<(), ChannelError>
pub fn add_fine( &mut self, fine_degree: usize, fine_channel_index: ChannelIndex, fine_universe_index: UniverseIndex, ) -> Result<(), ChannelError>
Adds a fine-degree channel to the parameter.
The fine channels must be added in sequential order. The length of the internal channel array dictates which fine degree is expected next.
§Arguments
fine_degree- The degree level of the fine channel (e.g., 1 for fine, 2 for ultra-fine).fine_index- The specific DMX-Channel and -Universe index for this fine degree.
§Errors
- [
FineDegreeOutOfRange]((ChannelError::FineDegreeOutOfRange) - If the requested degree exceedsMAX_FINE_DEGREES. FineDegreeExists- If a channel for this fine degree has already been added.FineDegreeTooHigh- If you attempt to add a higher fine degree before adding the intermediate ones.
Trait Implementations§
Source§impl Clone for ChannelParameter
impl Clone for ChannelParameter
Source§fn clone(&self) -> ChannelParameter
fn clone(&self) -> ChannelParameter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelParameter
impl Debug for ChannelParameter
Source§impl<'de> Deserialize<'de> for ChannelParameter
impl<'de> Deserialize<'de> for ChannelParameter
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 ChannelParameter
impl RefUnwindSafe for ChannelParameter
impl Send for ChannelParameter
impl Sync for ChannelParameter
impl Unpin for ChannelParameter
impl UnsafeUnpin for ChannelParameter
impl UnwindSafe for ChannelParameter
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