pub struct PowerSourceConfig<'a> {
pub status: PowerSourceStatusEnum,
pub order: u8,
pub description: &'a str,
pub endpoint_list: &'a [u16],
pub wired_current_type: WiredCurrentTypeEnum,
}Expand description
The application-supplied description of one power source.
Borrowed rather than owned, and expected to be a 'static constant: these
are firmware identity, in the same spirit as
super::fixed_label::FixedLabelEntry. A source whose status genuinely
changes at runtime is better served by a bespoke ClusterHandler impl
than by making this struct mutable.
Fields§
§status: PowerSourceStatusEnumWhether this source is currently supplying power.
order: u8Relative preference, 0 being the most preferred. Per the spec, the values across a node’s sources SHALL be distinct.
description: &'a strHuman-readable name of the source, e.g. "Mains". At most 60
characters; not enforced here, as with the other config-carrying
clusters.
endpoint_list: &'a [u16]The endpoints this source powers. May be empty, which per the spec means the source powers the node as a whole.
wired_current_type: WiredCurrentTypeEnumThe current type delivered by this wired source (mandatory under the
WIRED feature, which this handler always claims - see the module
docs on the WIRED/BAT choice conformance).
Implementations§
Source§impl PowerSourceConfig<'_>
impl PowerSourceConfig<'_>
Sourcepub const MAINS: PowerSourceConfig<'_>
pub const MAINS: PowerSourceConfig<'_>
A mains-powered source that powers the whole node.
The common case for a wired accessory, and the one that makes “is this device battery powered?” answerable with a plain no.
Trait Implementations§
Source§impl<'a> Clone for PowerSourceConfig<'a>
impl<'a> Clone for PowerSourceConfig<'a>
Source§fn clone(&self) -> PowerSourceConfig<'a>
fn clone(&self) -> PowerSourceConfig<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for PowerSourceConfig<'a>
impl<'a> Debug for PowerSourceConfig<'a>
impl<'a> Eq for PowerSourceConfig<'a>
Source§impl<'a> PartialEq for PowerSourceConfig<'a>
impl<'a> PartialEq for PowerSourceConfig<'a>
impl<'a> StructuralPartialEq for PowerSourceConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for PowerSourceConfig<'a>
impl<'a> RefUnwindSafe for PowerSourceConfig<'a>
impl<'a> Send for PowerSourceConfig<'a>
impl<'a> Sync for PowerSourceConfig<'a>
impl<'a> Unpin for PowerSourceConfig<'a>
impl<'a> UnsafeUnpin for PowerSourceConfig<'a>
impl<'a> UnwindSafe for PowerSourceConfig<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more