Struct Seg

Source
pub struct Seg {
Show 29 fields pub id: Option<i16>, pub start: Option<u16>, pub stop: Option<u16>, pub len: Option<u16>, pub grp: Option<u8>, pub spc: Option<u8>, pub of: Option<i16>, pub on: Option<bool>, pub frz: Option<bool>, pub bri: Option<u8>, pub cct: Option<u16>, pub set: Option<u8>, pub name: Option<String>, pub col: Option<Vec<Vec<u8>>>, pub fx: Option<u16>, pub sx: Option<u8>, pub ix: Option<u8>, pub pal: Option<u16>, pub c1: Option<u8>, pub c2: Option<u8>, pub c3: Option<u8>, pub sel: Option<bool>, pub rev: Option<bool>, pub mi: Option<bool>, pub o1: Option<bool>, pub o2: Option<bool>, pub o3: Option<bool>, pub si: Option<u8>, pub m12: Option<u8>,
}

Fields§

§id: Option<i16>

-1 to info.maxseg -1; Zero-indexed ID of the segment. May be omitted, in that case the ID will be inferred from the order of the segment objects in the seg array. -1 means apply to all selected segments

§start: Option<u16>

0 to info.leds.count -1; LED the segment starts at.

§stop: Option<u16>

0 to info.leds.count; LED the segment stops at, not included in range. If stop is set to a lower or equal value than start (setting to 0 is recommended), the segment is invalidated and deleted.

§len: Option<u16>

0 to info.leds.count; Length of the segment (stop - start). stop has preference, so if it is included, len is ignored.

§grp: Option<u8>

Grouping (how many consecutive LEDs of the same segment will be grouped to the same color)

§spc: Option<u8>

Spacing (how many LEDs are turned off and skipped between each group)

§of: Option<i16>

-len+1 to len; Offset (how many LEDs to rotate the virtual start of the segments, available since 0.13.0)

§on: Option<bool>

Turns on and off the individual segment. (available since 0.10.0)

§frz: Option<bool>

freezes/unfreezes the current effect

§bri: Option<u8>

Sets the individual segment brightness (available since 0.10.0)

§cct: Option<u16>

0 to 255 or 1900 to 10091; White spectrum color temperature (available since 0.13.0)

§set: Option<u8>

Undocumented?????? TODO

// 14-15 : 0-3 UI segment sets/groups -WLED source

§name: Option<String>

The name of the segment. Names are not present by default. if this is none, use “Segment{id}” to match the WLED UI

§col: Option<Vec<Vec<u8>>>

Array that has up to 3 color arrays as elements, the primary, secondary (background) and tertiary colors of the segment. Each color is an array of 3 or 4 bytes, which represent an RGB(W) color.

§fx: Option<u16>

0 to info.fxcount -1; ID of the effect or ~ to increment, ~- to decrement, or r for random.

§sx: Option<u8>

Relative effect speed. ~ to increment, ~- to decrement. ~10 to increment by 10, ~-10 to decrement by 10.

§ix: Option<u8>

Effect intensity. ~ to increment, ~- to decrement. ~10 to increment by 10, ~-10 to decrement by 10.

§pal: Option<u16>

0 to info.palcount -1; ID of the color palette or ~ to increment, ~- to decrement, or r for random.

§c1: Option<u8>

Effect custom slider 1. Custom sliders are hidden or displayed and labeled based on effect metadata.

§c2: Option<u8>

Effect custom slider 2.

§c3: Option<u8>

0 to 31; Effect custom slider 3.

§sel: Option<bool>

true if the segment is selected. Selected segments will have their state (color/FX) updated by APIs that don’t support segments (e.g. UDP sync, HTTP API). If no segment is selected, the first segment (id:0) will behave as if selected. WLED will report the state of the first (lowest id) segment that is selected to APIs (HTTP, MQTT, Blynk…), or mainseg in case no segment is selected and for the UDP API. Live data is always applied to all LEDs regardless of segment configuration.

§rev: Option<bool>

Flips the segment, causing animations to change direction.

§mi: Option<bool>

Mirrors the segment (available since 0.10.2)

§o1: Option<bool>

Effect option 1. Custom options are hidden or displayed and labeled based on effect metadata.

§o2: Option<bool>

Effect option 2.

§o3: Option<bool>

Effect option 3.

§si: Option<u8>

0 to 3; Setting of the sound simulation type for audio enhanced effects. (0: ‘BeatSin’, 1: ‘WeWillRockYou’, 2: ‘10_3’, 3: ‘14_3’) (as of 0.14.0-b1, there are these 4 types defined)

§m12: Option<u8>

0 to 4 [map1D2D.count]; Setting of segment field ‘Expand 1D FX’. (0: Pixels, 1: Bar, 2: Arc, 3: Corner)

Trait Implementations§

Source§

impl Clone for Seg

Source§

fn clone(&self) -> Seg

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Seg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Seg

Source§

fn default() -> Seg

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Seg

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Seg

Source§

fn eq(&self, other: &Seg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Seg

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Seg

Auto Trait Implementations§

§

impl Freeze for Seg

§

impl RefUnwindSafe for Seg

§

impl Send for Seg

§

impl Sync for Seg

§

impl Unpin for Seg

§

impl UnwindSafe for Seg

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,