pub struct PowerSourceClientView<'a> { /* private fields */ }Expand description
Per-exchange view onto the PowerSource cluster’s client operations. Returned by PowerSourceClient::power_source. Each method consumes the view (and therefore the underlying crate::transport::exchange::Exchange) — one exchange is one IM transaction.
Implementations§
Source§impl<'a> PowerSourceClientView<'a>
impl<'a> PowerSourceClientView<'a>
pub async fn status_read( self, endpoint: u16, ) -> Result<PowerSourceStatusEnum, Error>
pub async fn order_read(self, endpoint: u16) -> Result<u8, Error>
Sourcepub async fn description_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<&str, Error>) -> R,
) -> Result<R, Error>
pub async fn description_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<&str, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
pub async fn wired_assessed_input_voltage_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
pub async fn wired_assessed_input_frequency_read( self, endpoint: u16, ) -> Result<Maybe<u16, AsNullable>, Error>
pub async fn wired_current_type_read( self, endpoint: u16, ) -> Result<WiredCurrentTypeEnum, Error>
pub async fn wired_assessed_current_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
pub async fn wired_nominal_voltage_read( self, endpoint: u16, ) -> Result<u32, Error>
pub async fn wired_maximum_current_read( self, endpoint: u16, ) -> Result<u32, Error>
pub async fn wired_present_read(self, endpoint: u16) -> Result<bool, Error>
Sourcepub async fn active_wired_faults_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, WiredFaultEnum, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn active_wired_faults_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, WiredFaultEnum, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
pub async fn bat_voltage_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
pub async fn bat_percent_remaining_read( self, endpoint: u16, ) -> Result<Maybe<u8, AsNullable>, Error>
pub async fn bat_time_remaining_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
pub async fn bat_charge_level_read( self, endpoint: u16, ) -> Result<BatChargeLevelEnum, Error>
pub async fn bat_replacement_needed_read( self, endpoint: u16, ) -> Result<bool, Error>
pub async fn bat_replaceability_read( self, endpoint: u16, ) -> Result<BatReplaceabilityEnum, Error>
pub async fn bat_present_read(self, endpoint: u16) -> Result<bool, Error>
Sourcepub async fn active_bat_faults_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, BatFaultEnum, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn active_bat_faults_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, BatFaultEnum, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn bat_replacement_description_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<&str, Error>) -> R,
) -> Result<R, Error>
pub async fn bat_replacement_description_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<&str, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
pub async fn bat_common_designation_read( self, endpoint: u16, ) -> Result<BatCommonDesignationEnum, Error>
Sourcepub async fn bat_ansi_designation_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<&str, Error>) -> R,
) -> Result<R, Error>
pub async fn bat_ansi_designation_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<&str, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn bat_iec_designation_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<&str, Error>) -> R,
) -> Result<R, Error>
pub async fn bat_iec_designation_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<&str, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
pub async fn bat_approved_chemistry_read( self, endpoint: u16, ) -> Result<BatApprovedChemistryEnum, Error>
pub async fn bat_capacity_read(self, endpoint: u16) -> Result<u32, Error>
pub async fn bat_quantity_read(self, endpoint: u16) -> Result<u8, Error>
pub async fn bat_charge_state_read( self, endpoint: u16, ) -> Result<BatChargeStateEnum, Error>
pub async fn bat_time_to_full_charge_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
pub async fn bat_functional_while_charging_read( self, endpoint: u16, ) -> Result<bool, Error>
pub async fn bat_charging_current_read( self, endpoint: u16, ) -> Result<Maybe<u32, AsNullable>, Error>
Sourcepub async fn active_bat_charge_faults_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, BatChargeFaultEnum, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn active_bat_charge_faults_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, BatChargeFaultEnum, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn endpoint_list_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, u16, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn endpoint_list_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, u16, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn generated_command_list_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn generated_command_list_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn accepted_command_list_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn accepted_command_list_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
Sourcepub async fn attribute_list_read_with<R>(
self,
endpoint: u16,
f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R,
) -> Result<R, Error>
pub async fn attribute_list_read_with<R>( self, endpoint: u16, f: impl FnOnce(Result<TLVContainer<'_, u32, ArrayContainer>, Error>) -> R, ) -> Result<R, Error>
Read a non-scalar attribute (string, octet string, struct or list) whose value borrows the response buffer. Decodes the value and passes Result<Value, Error> to f while the borrow is live, returning the owned R that f produces (copy out what you need, e.g. |v| v.map(|s| s.to_string())). A non-served optional attribute surfaces as Err to f.
pub async fn feature_map_read(self, endpoint: u16) -> Result<u32, Error>
pub async fn cluster_revision_read(self, endpoint: u16) -> Result<u16, Error>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PowerSourceClientView<'a>
impl<'a> !Send for PowerSourceClientView<'a>
impl<'a> !Sync for PowerSourceClientView<'a>
impl<'a> !UnwindSafe for PowerSourceClientView<'a>
impl<'a> Freeze for PowerSourceClientView<'a>
impl<'a> Unpin for PowerSourceClientView<'a>
impl<'a> UnsafeUnpin for PowerSourceClientView<'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> 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