pub struct PowerSourceHandler<'a> { /* private fields */ }Expand description
The system implementation of a handler for the PowerSource Matter cluster.
Per-endpoint instance: a node with several power sources hosts one handler
per source, each on its own endpoint with its own Dataver.
Implementations§
Source§impl<'a> PowerSourceHandler<'a>
impl<'a> PowerSourceHandler<'a>
Sourcepub const fn new(
dataver: Dataver,
config: &'a PowerSourceConfig<'a>,
) -> PowerSourceHandler<'a>
pub const fn new( dataver: Dataver, config: &'a PowerSourceConfig<'a>, ) -> PowerSourceHandler<'a>
Create a new handler describing config.
Sourcepub const fn adapt(self) -> HandlerAdaptor<PowerSourceHandler<'a>>
pub const fn adapt(self) -> HandlerAdaptor<PowerSourceHandler<'a>>
Adapt the handler instance to the generic rs-matter Handler trait.
Trait Implementations§
Source§impl ClusterHandler for PowerSourceHandler<'_>
impl ClusterHandler for PowerSourceHandler<'_>
Source§const CLUSTER: Cluster<'static> = CLUSTER
const CLUSTER: Cluster<'static> = CLUSTER
The cluster-metadata corresponding to this handler trait.
fn dataver(&self) -> u32
fn dataver_changed(&self)
fn status(&self, _ctx: impl ReadContext) -> Result<PowerSourceStatusEnum, Error>
fn order(&self, _ctx: impl ReadContext) -> Result<u8, Error>
fn description<P>(
&self,
_ctx: impl ReadContext,
out: Utf8StrBuilder<P>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn wired_current_type( &self, _ctx: impl ReadContext, ) -> Result<WiredCurrentTypeEnum, Error>
fn endpoint_list<P>(
&self,
_ctx: impl ReadContext,
builder: ArrayAttributeRead<ToTLVArrayBuilder<P, u16>, ToTLVBuilder<P, u16>>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn lifecycle( &self, _ctx: impl HandlerContext, _op: LifecycleOp, ) -> Result<(), Error>
fn run( &self, _ctx: impl HandlerContext, ) -> impl Future<Output = Result<(), Error>>
fn wired_assessed_input_voltage( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn wired_assessed_input_frequency( &self, ctx: impl ReadContext, ) -> Result<Maybe<u16, AsNullable>, Error>
fn wired_assessed_current( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn wired_nominal_voltage(&self, ctx: impl ReadContext) -> Result<u32, Error>
fn wired_maximum_current(&self, ctx: impl ReadContext) -> Result<u32, Error>
fn wired_present(&self, ctx: impl ReadContext) -> Result<bool, Error>
fn active_wired_faults<P>(
&self,
ctx: impl ReadContext,
builder: ArrayAttributeRead<ToTLVArrayBuilder<P, WiredFaultEnum>, ToTLVBuilder<P, WiredFaultEnum>>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn bat_voltage( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn bat_percent_remaining( &self, ctx: impl ReadContext, ) -> Result<Maybe<u8, AsNullable>, Error>
fn bat_time_remaining( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn bat_charge_level( &self, ctx: impl ReadContext, ) -> Result<BatChargeLevelEnum, Error>
fn bat_replacement_needed(&self, ctx: impl ReadContext) -> Result<bool, Error>
fn bat_replaceability( &self, ctx: impl ReadContext, ) -> Result<BatReplaceabilityEnum, Error>
fn bat_present(&self, ctx: impl ReadContext) -> Result<bool, Error>
fn active_bat_faults<P>(
&self,
ctx: impl ReadContext,
builder: ArrayAttributeRead<ToTLVArrayBuilder<P, BatFaultEnum>, ToTLVBuilder<P, BatFaultEnum>>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn bat_replacement_description<P>(
&self,
ctx: impl ReadContext,
builder: Utf8StrBuilder<P>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn bat_common_designation( &self, ctx: impl ReadContext, ) -> Result<BatCommonDesignationEnum, Error>
fn bat_ansi_designation<P>(
&self,
ctx: impl ReadContext,
builder: Utf8StrBuilder<P>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn bat_iec_designation<P>(
&self,
ctx: impl ReadContext,
builder: Utf8StrBuilder<P>,
) -> Result<P, Error>where
P: TLVBuilderParent,
fn bat_approved_chemistry( &self, ctx: impl ReadContext, ) -> Result<BatApprovedChemistryEnum, Error>
fn bat_capacity(&self, ctx: impl ReadContext) -> Result<u32, Error>
fn bat_quantity(&self, ctx: impl ReadContext) -> Result<u8, Error>
fn bat_charge_state( &self, ctx: impl ReadContext, ) -> Result<BatChargeStateEnum, Error>
fn bat_time_to_full_charge( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn bat_functional_while_charging( &self, ctx: impl ReadContext, ) -> Result<bool, Error>
fn bat_charging_current( &self, ctx: impl ReadContext, ) -> Result<Maybe<u32, AsNullable>, Error>
fn active_bat_charge_faults<P>(
&self,
ctx: impl ReadContext,
builder: ArrayAttributeRead<ToTLVArrayBuilder<P, BatChargeFaultEnum>, ToTLVBuilder<P, BatChargeFaultEnum>>,
) -> Result<P, Error>where
P: TLVBuilderParent,
Auto Trait Implementations§
impl<'a> !Freeze for PowerSourceHandler<'a>
impl<'a> !RefUnwindSafe for PowerSourceHandler<'a>
impl<'a> !Sync for PowerSourceHandler<'a>
impl<'a> Send for PowerSourceHandler<'a>
impl<'a> Unpin for PowerSourceHandler<'a>
impl<'a> UnsafeUnpin for PowerSourceHandler<'a>
impl<'a> UnwindSafe for PowerSourceHandler<'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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T, I> IntoFallibleInit<T> for Iwhere
I: Init<T>,
impl<T, I> IntoFallibleInit<T> for Iwhere
I: Init<T>,
Source§fn into_fallible<E>(self) -> impl Init<T, E>
fn into_fallible<E>(self) -> impl Init<T, E>
Convert the infallible initializer to a fallible one.
Source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
Source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.