diff --git a/bloat-check/src/bin/bloat-check.rs b/bloat-check/src/bin/bloat-check.rs index 7131526ad..8ad0826e7 100644 --- a/bloat-check/src/bin/bloat-check.rs +++ b/bloat-check/src/bin/bloat-check.rs @@ -75,7 +75,7 @@ use rs_matter::dm::networks::wireless::{ use rs_matter::dm::networks::NetChangeNotif; use rs_matter::dm::subscriptions::{Subscriptions, DEFAULT_MAX_SUBSCRIPTIONS}; use rs_matter::dm::{endpoints, IMBuffer}; -use rs_matter::dm::{Async, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node}; +use rs_matter::dm::{DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node}; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; use rs_matter::pairing::DiscoveryCapabilities; @@ -197,8 +197,8 @@ type AppBtp<'a> = Btp<&'a BtpContext, CriticalSectionRawMutex, FakeGattPeripheral>; type AppTransport<'a> = ChainedNetwork, fn(&Address) -> bool>; type AppHandler<'a> = handler_chain_type!( - EpClMatcher => on_off::HandlerAsyncAdaptor>, - EpClMatcher => Async>> + EpClMatcher => on_off::HandlerAdaptor>, + EpClMatcher => desc::HandlerAdaptor> | EmptyHandler ); type AppDmHandler<'a> = WifiHandler<'a, &'a AppNetCtl<'a>, SysHandler<'a, AppHandler<'a>>>; @@ -635,11 +635,11 @@ where EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ), ), ) diff --git a/examples/src/bin/bridge.rs b/examples/src/bin/bridge.rs index bbd27e629..000711842 100644 --- a/examples/src/bin/bridge.rs +++ b/examples/src/bin/bridge.rs @@ -36,8 +36,8 @@ use rs_matter::dm::endpoints; use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, EmptyHandler, Endpoint, - EpClMatcher, InvokeContext, Node, ReadContext, + AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, + InvokeContext, Node, ReadContext, }; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; @@ -220,10 +220,7 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( // https://www.1home.io/docs/en/server/configure-devices#manage-rooms .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async( - desc::DescHandler::new_aggregator(Dataver::new_rand(matter.rand())) - .adapt(), - ), + desc::DescHandler::new_aggregator(Dataver::new_rand(matter.rand())).adapt(), ) // The following chains are the handlers for the bridged devices corresponding to ep 2 and ep3. // @@ -236,27 +233,27 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( // the lamp, or to switch it on/off. .chain( EpClMatcher::new(Some(2), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(2), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off_ep2), + on_off::HandlerAdaptor(on_off_ep2), ) .chain( EpClMatcher::new(Some(2), Some(BridgedHandler::CLUSTER.id)), - Async(BridgedHandler::new(Dataver::new_rand(matter.rand())).adapt()), + BridgedHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(3), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(3), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off_ep3), + on_off::HandlerAdaptor(on_off_ep3), ) .chain( EpClMatcher::new(Some(3), Some(BridgedHandler::CLUSTER.id)), - Async(BridgedHandler::new(Dataver::new_rand(matter.rand())).adapt()), + BridgedHandler::new(Dataver::new_rand(matter.rand())).adapt(), ), ), ), @@ -291,7 +288,9 @@ impl bridged_device_basic_information::ClusterHandler for BridgedHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl bridged_device_basic_information::ClusterSyncHandler for BridgedHandler { fn reachable(&self, _ctx: impl ReadContext) -> Result { // This is the only mandatory attribute. // diff --git a/examples/src/bin/chip_tool_tests.rs b/examples/src/bin/chip_tool_tests.rs index bc7f09802..d42dab1be 100644 --- a/examples/src/bin/chip_tool_tests.rs +++ b/examples/src/bin/chip_tool_tests.rs @@ -49,8 +49,7 @@ use rs_matter::dm::endpoints; use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, - Node, + AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node, }; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; @@ -276,21 +275,19 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ) .chain( EpClMatcher::new(Some(1), Some(UnitTestingHandler::CLUSTER.id)), - Async( - UnitTestingHandler::new( - Dataver::new_rand(matter.rand()), - unit_testing_data, - ) - .adapt(), - ), + UnitTestingHandler::new( + Dataver::new_rand(matter.rand()), + unit_testing_data, + ) + .adapt(), ), ), ), diff --git a/examples/src/bin/dimmable_light.rs b/examples/src/bin/dimmable_light.rs index 4d95de226..8ce3478e8 100644 --- a/examples/src/bin/dimmable_light.rs +++ b/examples/src/bin/dimmable_light.rs @@ -49,8 +49,8 @@ use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::IMBuffer; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, EmptyHandler, Endpoint, - EpClMatcher, Node, + AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, + Node, }; use rs_matter::error::{Error, ErrorCode}; use rs_matter::pairing::qr::QrTextType; @@ -282,15 +282,15 @@ fn dm_handler<'a, LH: LevelControlHooks, OH: OnOffHooks>( EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(OnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ) .chain( EpClMatcher::new(Some(1), Some(LevelControlDeviceLogic::CLUSTER.id)), - level_control::HandlerAsyncAdaptor(level_control), + level_control::HandlerAdaptor(level_control), ), ), ), diff --git a/examples/src/bin/media_player.rs b/examples/src/bin/media_player.rs index 344cb99e0..1ea66d40b 100644 --- a/examples/src/bin/media_player.rs +++ b/examples/src/bin/media_player.rs @@ -34,19 +34,19 @@ use log::info; // Import the MediaPlayback, ContentLauncher and KeypadInput clusters from `rs-matter`. // -// User needs to implement the `ClusterAsyncHandler` trait or the `ClusterHandler` trait +// User needs to implement the `ClusterHandler` trait // so as to handle the requests from the controller. use rs_matter::dm::clusters::decl::content_launcher::{ - self, ClusterAsyncHandler as _, LaunchContentRequest, LaunchURLRequest, - LauncherResponseBuilder, SupportedProtocolsBitmap, + self, ClusterHandler as _, LaunchContentRequest, LaunchURLRequest, LauncherResponseBuilder, + SupportedProtocolsBitmap, }; use rs_matter::dm::clusters::decl::keypad_input::{ - self, ClusterAsyncHandler as _, SendKeyRequest, SendKeyResponseBuilder, + self, ClusterHandler as _, SendKeyRequest, SendKeyResponseBuilder, }; use rs_matter::dm::clusters::decl::media_playback::{ - self, ActivateAudioTrackRequest, ActivateTextTrackRequest, ClusterAsyncHandler as _, + self, ActivateAudioTrackRequest, ActivateTextTrackRequest, ClusterHandler as _, FastForwardRequest, PlaybackResponseBuilder, PlaybackStateEnum, RewindRequest, SeekRequest, SkipBackwardRequest, SkipForwardRequest, StatusEnum, }; @@ -61,8 +61,8 @@ use rs_matter::dm::endpoints; use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::{ - ArrayAttributeRead, Async, AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, - EmptyHandler, Endpoint, EpClMatcher, InvokeContext, Node, ReadContext, + ArrayAttributeRead, AsyncHandler, AsyncMetadata, Cluster, DataModel, Dataver, EmptyHandler, + Endpoint, EpClMatcher, InvokeContext, Node, ReadContext, }; use rs_matter::error::{Error, ErrorCode}; use rs_matter::pairing::qr::QrTextType; @@ -196,7 +196,7 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(MediaHandler::CLUSTER.id)), @@ -212,7 +212,7 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ), ), ), @@ -235,8 +235,8 @@ impl MediaHandler { } /// Adapt the handler instance to the generic `rs-matter` `AsyncHandler` trait - pub const fn adapt(self) -> media_playback::HandlerAsyncAdaptor { - media_playback::HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> media_playback::HandlerAdaptor { + media_playback::HandlerAdaptor(self) } /// Update the state of the handler @@ -251,7 +251,7 @@ impl MediaHandler { } } -impl media_playback::ClusterAsyncHandler for MediaHandler { +impl media_playback::ClusterHandler for MediaHandler { /// The metadata cluster definition corresponding to the handler const CLUSTER: Cluster<'static> = media_playback::FULL_CLUSTER .with_attrs(with!(required)) @@ -268,15 +268,17 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} - async fn current_state( +impl media_playback::ClusterSyncHandler for MediaHandler { + fn current_state( &self, _ctx: impl ReadContext, ) -> Result { Ok(self.state.get()) } - async fn handle_play( + fn handle_play( &self, ctx: impl InvokeContext, response: media_playback::PlaybackResponseBuilder

, @@ -288,7 +290,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { response.status(StatusEnum::Success)?.data(None)?.end() } - async fn handle_pause( + fn handle_pause( &self, ctx: impl InvokeContext, response: PlaybackResponseBuilder

, @@ -300,7 +302,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { response.status(StatusEnum::Success)?.data(None)?.end() } - async fn handle_stop( + fn handle_stop( &self, ctx: impl InvokeContext, response: PlaybackResponseBuilder

, @@ -312,7 +314,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { response.status(StatusEnum::Success)?.data(None)?.end() } - async fn handle_start_over( + fn handle_start_over( &self, _ctx: impl InvokeContext, _response: PlaybackResponseBuilder

, @@ -321,7 +323,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_previous( + fn handle_previous( &self, _ctx: impl InvokeContext, _response: PlaybackResponseBuilder

, @@ -330,7 +332,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_next( + fn handle_next( &self, _ctx: impl InvokeContext, _response: PlaybackResponseBuilder

, @@ -339,7 +341,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_rewind( + fn handle_rewind( &self, _ctx: impl InvokeContext, _request: RewindRequest<'_>, @@ -349,7 +351,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_fast_forward( + fn handle_fast_forward( &self, _ctx: impl InvokeContext, _request: FastForwardRequest<'_>, @@ -359,7 +361,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_skip_forward( + fn handle_skip_forward( &self, _ctx: impl InvokeContext, _request: SkipForwardRequest<'_>, @@ -369,7 +371,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_skip_backward( + fn handle_skip_backward( &self, _ctx: impl InvokeContext, _request: SkipBackwardRequest<'_>, @@ -379,7 +381,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_seek( + fn handle_seek( &self, _ctx: impl InvokeContext, _request: SeekRequest<'_>, @@ -389,7 +391,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_activate_audio_track( + fn handle_activate_audio_track( &self, _ctx: impl InvokeContext, _request: ActivateAudioTrackRequest<'_>, @@ -398,7 +400,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_activate_text_track( + fn handle_activate_text_track( &self, _ctx: impl InvokeContext, _request: ActivateTextTrackRequest<'_>, @@ -407,7 +409,7 @@ impl media_playback::ClusterAsyncHandler for MediaHandler { Err(ErrorCode::InvalidCommand.into()) } - async fn handle_deactivate_text_track(&self, _ctx: impl InvokeContext) -> Result<(), Error> { + fn handle_deactivate_text_track(&self, _ctx: impl InvokeContext) -> Result<(), Error> { // Not supported Err(ErrorCode::InvalidCommand.into()) } @@ -424,12 +426,12 @@ impl ContentHandler { } /// Adapt the handler instance to the generic `rs-matter` `AsyncHandler` trait - pub const fn adapt(self) -> content_launcher::HandlerAsyncAdaptor { - content_launcher::HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> content_launcher::HandlerAdaptor { + content_launcher::HandlerAdaptor(self) } } -impl content_launcher::ClusterAsyncHandler for ContentHandler { +impl content_launcher::ClusterHandler for ContentHandler { const CLUSTER: Cluster<'static> = content_launcher::FULL_CLUSTER .with_features(0b11) .with_attrs( @@ -444,8 +446,10 @@ impl content_launcher::ClusterAsyncHandler for ContentHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} - async fn accept_header( +impl content_launcher::ClusterSyncHandler for ContentHandler { + fn accept_header( &self, _ctx: impl ReadContext, builder: ArrayAttributeRead, Utf8StrBuilder

>, @@ -488,14 +492,14 @@ impl content_launcher::ClusterAsyncHandler for ContentHandler { } } - async fn supported_streaming_protocols( + fn supported_streaming_protocols( &self, _ctx: impl ReadContext, ) -> Result { Ok(SupportedProtocolsBitmap::all()) } - async fn handle_launch_url( + fn handle_launch_url( &self, _ctx: impl InvokeContext, request: LaunchURLRequest<'_>, @@ -509,7 +513,7 @@ impl content_launcher::ClusterAsyncHandler for ContentHandler { .end() } - async fn handle_launch_content( + fn handle_launch_content( &self, _ctx: impl InvokeContext, request: LaunchContentRequest<'_>, @@ -535,12 +539,12 @@ impl KeypadInputHandler { } /// Adapt the handler instance to the generic `rs-matter` `AsyncHandler` trait - pub const fn adapt(self) -> keypad_input::HandlerAsyncAdaptor { - keypad_input::HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> keypad_input::HandlerAdaptor { + keypad_input::HandlerAdaptor(self) } } -impl keypad_input::ClusterAsyncHandler for KeypadInputHandler { +impl keypad_input::ClusterHandler for KeypadInputHandler { const CLUSTER: Cluster<'static> = keypad_input::FULL_CLUSTER .with_attrs(with!(required)) .with_cmds(with!(keypad_input::CommandId::SendKey)); @@ -552,8 +556,10 @@ impl keypad_input::ClusterAsyncHandler for KeypadInputHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} - async fn handle_send_key( +impl keypad_input::ClusterSyncHandler for KeypadInputHandler { + fn handle_send_key( &self, _ctx: impl InvokeContext, request: SendKeyRequest<'_>, diff --git a/examples/src/bin/onoff_light.rs b/examples/src/bin/onoff_light.rs index 0454ac911..1fdc39a50 100644 --- a/examples/src/bin/onoff_light.rs +++ b/examples/src/bin/onoff_light.rs @@ -37,8 +37,7 @@ use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::IMBuffer; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, - Node, + AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node, }; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; @@ -224,11 +223,11 @@ fn dm_handler<'a, OH: OnOffHooks, LH: LevelControlHooks>( EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ), ), ), diff --git a/examples/src/bin/onoff_light_bt.rs b/examples/src/bin/onoff_light_bt.rs index 0b816d5ba..652d74bdf 100644 --- a/examples/src/bin/onoff_light_bt.rs +++ b/examples/src/bin/onoff_light_bt.rs @@ -51,8 +51,7 @@ use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::networks::wireless::{NetCtlState, NetCtlWithStatusImpl, WifiNetworks}; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, - Node, + AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node, }; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; @@ -271,11 +270,11 @@ where EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ), ), ), diff --git a/examples/src/bin/speaker.rs b/examples/src/bin/speaker.rs index 911d79ac2..b01389c9b 100644 --- a/examples/src/bin/speaker.rs +++ b/examples/src/bin/speaker.rs @@ -38,8 +38,7 @@ use rs_matter::dm::endpoints; use rs_matter::dm::networks::unix::UnixNetifs; use rs_matter::dm::subscriptions::DefaultSubscriptions; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, - Node, + AsyncHandler, AsyncMetadata, DataModel, Dataver, EmptyHandler, Endpoint, EpClMatcher, Node, }; use rs_matter::error::Error; use rs_matter::pairing::qr::QrTextType; @@ -191,15 +190,15 @@ fn dm_handler<'a, LH: LevelControlHooks, OH: OnOffHooks>( EmptyHandler .chain( EpClMatcher::new(Some(1), Some(desc::DescHandler::CLUSTER.id)), - Async(desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + desc::DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(LevelControlDeviceLogic::CLUSTER.id)), - level_control::HandlerAsyncAdaptor(level_control), + level_control::HandlerAdaptor(level_control), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ), ), ), diff --git a/rs-matter-macros/.rustfmt.toml b/rs-matter-macros/.rustfmt.toml new file mode 100644 index 000000000..36c419bb3 --- /dev/null +++ b/rs-matter-macros/.rustfmt.toml @@ -0,0 +1 @@ +edition = "2021" \ No newline at end of file diff --git a/rs-matter-macros/src/idl.rs b/rs-matter-macros/src/idl.rs index e557a642e..3e9e9493e 100644 --- a/rs-matter-macros/src/idl.rs +++ b/rs-matter-macros/src/idl.rs @@ -33,6 +33,7 @@ mod parser; mod struct_in; mod struct_out; +use crate::idl::handler::HandlerType; use crate::idl::parser::Entities; pub use parser::Idl; @@ -70,13 +71,12 @@ impl IdlGenerateContext { /// in the provided IDL cluster: /// pub fn cluster(cluster: &Cluster, globals: &Entities, context: &IdlGenerateContext) -> TokenStream { - cluster_internal(cluster, globals, true, context) + cluster_internal(cluster, globals, context) } fn cluster_internal( cluster: &Cluster, globals: &Entities, - with_async: bool, context: &IdlGenerateContext, ) -> TokenStream { let cluster_module_name = Ident::new( @@ -101,9 +101,10 @@ fn cluster_internal( let command_response_id = cluster::command_response_id(entities, context); let cluster_meta = cluster::cluster(cluster, globals, context); - let handler = handler::handler(false, false, cluster, globals, context); - let handler_inherent_impl = handler::handler(false, true, cluster, globals, context); - let handler_adaptor = handler::handler_adaptor(false, cluster, globals, context); + let handler = handler::handler(HandlerType::Handler, cluster, globals, context); + let sync_handler = handler::handler(HandlerType::Sync, cluster, globals, context); + let handler_inherent_impl = handler::handler(HandlerType::Delegate, cluster, globals, context); + let handler_adaptor = handler::handler_adaptor(cluster, globals, context); let quote = quote!( #bitmaps @@ -124,6 +125,8 @@ fn cluster_internal( #cluster_meta + #sync_handler + #handler #handler_inherent_impl @@ -131,24 +134,6 @@ fn cluster_internal( #handler_adaptor ); - let quote = if with_async { - let async_handler = handler::handler(true, false, cluster, globals, context); - let async_handler_inherent_impl = handler::handler(true, true, cluster, globals, context); - let async_handler_adaptor = handler::handler_adaptor(true, cluster, globals, context); - - quote!( - #quote - - #async_handler - - #async_handler_inherent_impl - - #async_handler_adaptor - ) - } else { - quote - }; - quote!( #[doc = #cluster_module_doc] #[allow(async_fn_in_trait)] @@ -241,11 +226,11 @@ mod tests { // panic!( // "====\n{}\n====", - // &cluster_internal(cluster, &idl.globals, false, &context) + // &cluster_internal(cluster, &idl.globals, &context) // ); assert_tokenstreams_eq!( - &cluster_internal(cluster, &idl.globals, false, &context), + &cluster_internal(cluster, &idl.globals, &context), &TOKEN_STREAM_OUTPUT ); } @@ -274,193 +259,417 @@ mod tests { #[allow(clippy::uninlined_format_args)] #[allow(unexpected_cfgs)] pub mod globals { - #[cfg(not(feature = "defmt"))] rs_matter_crate::reexport::bitflags::bitflags! { # [repr (transparent)] # [derive (Default , Debug , Copy , Clone , Eq , PartialEq , Hash)] pub struct TestGlobalBitmap : u32 { const FIRST_BIT = 1 ; const SECOND_BIT = 2 ; const _INTERNAL_ALL_BITS = ! 0 ; } } #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::bitflags! { # [repr (transparent)] # [derive (Default)] pub struct TestGlobalBitmap : u32 { const FIRST_BIT = 1 ; const SECOND_BIT = 2 ; const _INTERNAL_ALL_BITS = ! 0 ; } } rs_matter_crate::bitflags_tlv!(TestGlobalBitmap , u32); #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, rs_matter_crate :: tlv :: FromTLV, rs_matter_crate :: tlv :: ToTLV)] + #[cfg(not(feature = "defmt"))] + rs_matter_crate::reexport::bitflags::bitflags! { # [repr (transparent)] # [derive (Default , Debug , Copy , Clone , Eq , PartialEq , Hash)] pub struct TestGlobalBitmap : u32 { const FIRST_BIT = 1 ; const SECOND_BIT = 2 ; const _INTERNAL_ALL_BITS = ! 0 ; } } + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::bitflags! { # [repr (transparent)] # [derive (Default)] pub struct TestGlobalBitmap : u32 { const FIRST_BIT = 1 ; const SECOND_BIT = 2 ; const _INTERNAL_ALL_BITS = ! 0 ; } } + rs_matter_crate::bitflags_tlv!(TestGlobalBitmap, u32); + #[derive( + Debug, + PartialEq, + Eq, + Copy, + Clone, + Hash, + rs_matter_crate :: tlv :: FromTLV, + rs_matter_crate :: tlv :: ToTLV, + )] #[tlvargs(datatype = "u8")] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] pub enum AreaTypeTag { - #[enumval(0)] Aisle = 0, - #[enumval(1)] Attic = 1, - #[enumval(2)] BackDoor = 2, - #[enumval(3)] BackYard = 3, - #[enumval(4)] Balcony = 4, - #[enumval(5)] Ballroom = 5, - #[enumval(6)] Bathroom = 6, - #[enumval(7)] Bedroom = 7, - #[enumval(8)] Border = 8, - #[enumval(9)] Boxroom = 9, - #[enumval(10)] BreakfastRoom = 10, - #[enumval(11)] Carport = 11, - #[enumval(12)] Cellar = 12, - #[enumval(13)] Cloakroom = 13, - #[enumval(14)] Closet = 14, - #[enumval(15)] Conservatory = 15, - #[enumval(16)] Corridor = 16, - #[enumval(17)] CraftRoom = 17, - #[enumval(18)] Cupboard = 18, - #[enumval(19)] Deck = 19, - #[enumval(20)] Den = 20, - #[enumval(21)] Dining = 21, - #[enumval(22)] DrawingRoom = 22, - #[enumval(23)] DressingRoom = 23, - #[enumval(24)] Driveway = 24, - #[enumval(25)] Elevator = 25, - #[enumval(26)] Ensuite = 26, - #[enumval(27)] Entrance = 27, - #[enumval(28)] Entryway = 28, - #[enumval(29)] FamilyRoom = 29, - #[enumval(30)] Foyer = 30, - #[enumval(31)] FrontDoor = 31, - #[enumval(32)] FrontYard = 32, - #[enumval(33)] GameRoom = 33, - #[enumval(34)] Garage = 34, - #[enumval(35)] GarageDoor = 35, - #[enumval(36)] Garden = 36, - #[enumval(37)] GardenDoor = 37, - #[enumval(38)] GuestBathroom = 38, - #[enumval(39)] GuestBedroom = 39, - #[enumval(41)] GuestRoom = 41, - #[enumval(42)] Gym = 42, - #[enumval(43)] Hallway = 43, - #[enumval(44)] HearthRoom = 44, - #[enumval(45)] KidsRoom = 45, - #[enumval(46)] KidsBedroom = 46, - #[enumval(47)] Kitchen = 47, - #[enumval(49)] LaundryRoom = 49, - #[enumval(50)] Lawn = 50, - #[enumval(51)] Library = 51, - #[enumval(52)] LivingRoom = 52, - #[enumval(53)] Lounge = 53, - #[enumval(54)] MediaTVRoom = 54, - #[enumval(55)] MudRoom = 55, - #[enumval(56)] MusicRoom = 56, - #[enumval(57)] Nursery = 57, - #[enumval(58)] Office = 58, - #[enumval(59)] OutdoorKitchen = 59, - #[enumval(60)] Outside = 60, - #[enumval(61)] Pantry = 61, - #[enumval(62)] ParkingLot = 62, - #[enumval(63)] Parlor = 63, - #[enumval(64)] Patio = 64, - #[enumval(65)] PlayRoom = 65, - #[enumval(66)] PoolRoom = 66, - #[enumval(67)] Porch = 67, - #[enumval(68)] PrimaryBathroom = 68, - #[enumval(69)] PrimaryBedroom = 69, - #[enumval(70)] Ramp = 70, - #[enumval(71)] ReceptionRoom = 71, - #[enumval(72)] RecreationRoom = 72, - #[enumval(74)] Roof = 74, - #[enumval(75)] Sauna = 75, - #[enumval(76)] Scullery = 76, - #[enumval(77)] SewingRoom = 77, - #[enumval(78)] Shed = 78, - #[enumval(79)] SideDoor = 79, - #[enumval(80)] SideYard = 80, - #[enumval(81)] SittingRoom = 81, - #[enumval(82)] Snug = 82, - #[enumval(83)] Spa = 83, - #[enumval(84)] Staircase = 84, - #[enumval(85)] SteamRoom = 85, - #[enumval(86)] StorageRoom = 86, - #[enumval(87)] Studio = 87, - #[enumval(88)] Study = 88, - #[enumval(89)] SunRoom = 89, - #[enumval(90)] SwimmingPool = 90, - #[enumval(91)] Terrace = 91, - #[enumval(92)] UtilityRoom = 92, - #[enumval(93)] Ward = 93, - #[enumval(94)] Workshop = 94, - #[enumval(95)] Toilet = 95, - } - #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, rs_matter_crate :: tlv :: FromTLV, rs_matter_crate :: tlv :: ToTLV)] + #[enumval(0)] + Aisle = 0, + #[enumval(1)] + Attic = 1, + #[enumval(2)] + BackDoor = 2, + #[enumval(3)] + BackYard = 3, + #[enumval(4)] + Balcony = 4, + #[enumval(5)] + Ballroom = 5, + #[enumval(6)] + Bathroom = 6, + #[enumval(7)] + Bedroom = 7, + #[enumval(8)] + Border = 8, + #[enumval(9)] + Boxroom = 9, + #[enumval(10)] + BreakfastRoom = 10, + #[enumval(11)] + Carport = 11, + #[enumval(12)] + Cellar = 12, + #[enumval(13)] + Cloakroom = 13, + #[enumval(14)] + Closet = 14, + #[enumval(15)] + Conservatory = 15, + #[enumval(16)] + Corridor = 16, + #[enumval(17)] + CraftRoom = 17, + #[enumval(18)] + Cupboard = 18, + #[enumval(19)] + Deck = 19, + #[enumval(20)] + Den = 20, + #[enumval(21)] + Dining = 21, + #[enumval(22)] + DrawingRoom = 22, + #[enumval(23)] + DressingRoom = 23, + #[enumval(24)] + Driveway = 24, + #[enumval(25)] + Elevator = 25, + #[enumval(26)] + Ensuite = 26, + #[enumval(27)] + Entrance = 27, + #[enumval(28)] + Entryway = 28, + #[enumval(29)] + FamilyRoom = 29, + #[enumval(30)] + Foyer = 30, + #[enumval(31)] + FrontDoor = 31, + #[enumval(32)] + FrontYard = 32, + #[enumval(33)] + GameRoom = 33, + #[enumval(34)] + Garage = 34, + #[enumval(35)] + GarageDoor = 35, + #[enumval(36)] + Garden = 36, + #[enumval(37)] + GardenDoor = 37, + #[enumval(38)] + GuestBathroom = 38, + #[enumval(39)] + GuestBedroom = 39, + #[enumval(41)] + GuestRoom = 41, + #[enumval(42)] + Gym = 42, + #[enumval(43)] + Hallway = 43, + #[enumval(44)] + HearthRoom = 44, + #[enumval(45)] + KidsRoom = 45, + #[enumval(46)] + KidsBedroom = 46, + #[enumval(47)] + Kitchen = 47, + #[enumval(49)] + LaundryRoom = 49, + #[enumval(50)] + Lawn = 50, + #[enumval(51)] + Library = 51, + #[enumval(52)] + LivingRoom = 52, + #[enumval(53)] + Lounge = 53, + #[enumval(54)] + MediaTVRoom = 54, + #[enumval(55)] + MudRoom = 55, + #[enumval(56)] + MusicRoom = 56, + #[enumval(57)] + Nursery = 57, + #[enumval(58)] + Office = 58, + #[enumval(59)] + OutdoorKitchen = 59, + #[enumval(60)] + Outside = 60, + #[enumval(61)] + Pantry = 61, + #[enumval(62)] + ParkingLot = 62, + #[enumval(63)] + Parlor = 63, + #[enumval(64)] + Patio = 64, + #[enumval(65)] + PlayRoom = 65, + #[enumval(66)] + PoolRoom = 66, + #[enumval(67)] + Porch = 67, + #[enumval(68)] + PrimaryBathroom = 68, + #[enumval(69)] + PrimaryBedroom = 69, + #[enumval(70)] + Ramp = 70, + #[enumval(71)] + ReceptionRoom = 71, + #[enumval(72)] + RecreationRoom = 72, + #[enumval(74)] + Roof = 74, + #[enumval(75)] + Sauna = 75, + #[enumval(76)] + Scullery = 76, + #[enumval(77)] + SewingRoom = 77, + #[enumval(78)] + Shed = 78, + #[enumval(79)] + SideDoor = 79, + #[enumval(80)] + SideYard = 80, + #[enumval(81)] + SittingRoom = 81, + #[enumval(82)] + Snug = 82, + #[enumval(83)] + Spa = 83, + #[enumval(84)] + Staircase = 84, + #[enumval(85)] + SteamRoom = 85, + #[enumval(86)] + StorageRoom = 86, + #[enumval(87)] + Studio = 87, + #[enumval(88)] + Study = 88, + #[enumval(89)] + SunRoom = 89, + #[enumval(90)] + SwimmingPool = 90, + #[enumval(91)] + Terrace = 91, + #[enumval(92)] + UtilityRoom = 92, + #[enumval(93)] + Ward = 93, + #[enumval(94)] + Workshop = 94, + #[enumval(95)] + Toilet = 95, + } + #[derive( + Debug, + PartialEq, + Eq, + Copy, + Clone, + Hash, + rs_matter_crate :: tlv :: FromTLV, + rs_matter_crate :: tlv :: ToTLV, + )] #[tlvargs(datatype = "u8")] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] - pub enum AtomicRequestTypeEnum { #[enumval(0)] BeginWrite = 0, #[enumval(1)] CommitWrite = 1, #[enumval(2)] RollbackWrite = 2 } - #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash, rs_matter_crate :: tlv :: FromTLV, rs_matter_crate :: tlv :: ToTLV)] + pub enum AtomicRequestTypeEnum { + #[enumval(0)] + BeginWrite = 0, + #[enumval(1)] + CommitWrite = 1, + #[enumval(2)] + RollbackWrite = 2, + } + #[derive( + Debug, + PartialEq, + Eq, + Copy, + Clone, + Hash, + rs_matter_crate :: tlv :: FromTLV, + rs_matter_crate :: tlv :: ToTLV, + )] #[tlvargs(datatype = "u8")] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] pub enum LandmarkTag { - #[enumval(0)] AirConditioner = 0, - #[enumval(1)] AirPurifier = 1, - #[enumval(2)] BackDoor = 2, - #[enumval(3)] BarStool = 3, - #[enumval(4)] BathMat = 4, - #[enumval(5)] Bathtub = 5, - #[enumval(6)] Bed = 6, - #[enumval(7)] Bookshelf = 7, - #[enumval(8)] Chair = 8, - #[enumval(9)] ChristmasTree = 9, - #[enumval(10)] CoatRack = 10, - #[enumval(11)] CoffeeTable = 11, - #[enumval(12)] CookingRange = 12, - #[enumval(13)] Couch = 13, - #[enumval(14)] Countertop = 14, - #[enumval(15)] Cradle = 15, - #[enumval(16)] Crib = 16, - #[enumval(17)] Desk = 17, - #[enumval(18)] DiningTable = 18, - #[enumval(19)] Dishwasher = 19, - #[enumval(20)] Door = 20, - #[enumval(21)] Dresser = 21, - #[enumval(22)] LaundryDryer = 22, - #[enumval(23)] Fan = 23, - #[enumval(24)] Fireplace = 24, - #[enumval(25)] Freezer = 25, - #[enumval(26)] FrontDoor = 26, - #[enumval(27)] HighChair = 27, - #[enumval(28)] KitchenIsland = 28, - #[enumval(29)] Lamp = 29, - #[enumval(30)] LitterBox = 30, - #[enumval(31)] Mirror = 31, - #[enumval(32)] Nightstand = 32, - #[enumval(33)] Oven = 33, - #[enumval(34)] PetBed = 34, - #[enumval(35)] PetBowl = 35, - #[enumval(36)] PetCrate = 36, - #[enumval(37)] Refrigerator = 37, - #[enumval(38)] ScratchingPost = 38, - #[enumval(39)] ShoeRack = 39, - #[enumval(40)] Shower = 40, - #[enumval(41)] SideDoor = 41, - #[enumval(42)] Sink = 42, - #[enumval(43)] Sofa = 43, - #[enumval(44)] Stove = 44, - #[enumval(45)] Table = 45, - #[enumval(46)] Toilet = 46, - #[enumval(47)] TrashCan = 47, - #[enumval(48)] LaundryWasher = 48, - #[enumval(49)] Window = 49, - #[enumval(50)] WineCooler = 50, + #[enumval(0)] + AirConditioner = 0, + #[enumval(1)] + AirPurifier = 1, + #[enumval(2)] + BackDoor = 2, + #[enumval(3)] + BarStool = 3, + #[enumval(4)] + BathMat = 4, + #[enumval(5)] + Bathtub = 5, + #[enumval(6)] + Bed = 6, + #[enumval(7)] + Bookshelf = 7, + #[enumval(8)] + Chair = 8, + #[enumval(9)] + ChristmasTree = 9, + #[enumval(10)] + CoatRack = 10, + #[enumval(11)] + CoffeeTable = 11, + #[enumval(12)] + CookingRange = 12, + #[enumval(13)] + Couch = 13, + #[enumval(14)] + Countertop = 14, + #[enumval(15)] + Cradle = 15, + #[enumval(16)] + Crib = 16, + #[enumval(17)] + Desk = 17, + #[enumval(18)] + DiningTable = 18, + #[enumval(19)] + Dishwasher = 19, + #[enumval(20)] + Door = 20, + #[enumval(21)] + Dresser = 21, + #[enumval(22)] + LaundryDryer = 22, + #[enumval(23)] + Fan = 23, + #[enumval(24)] + Fireplace = 24, + #[enumval(25)] + Freezer = 25, + #[enumval(26)] + FrontDoor = 26, + #[enumval(27)] + HighChair = 27, + #[enumval(28)] + KitchenIsland = 28, + #[enumval(29)] + Lamp = 29, + #[enumval(30)] + LitterBox = 30, + #[enumval(31)] + Mirror = 31, + #[enumval(32)] + Nightstand = 32, + #[enumval(33)] + Oven = 33, + #[enumval(34)] + PetBed = 34, + #[enumval(35)] + PetBowl = 35, + #[enumval(36)] + PetCrate = 36, + #[enumval(37)] + Refrigerator = 37, + #[enumval(38)] + ScratchingPost = 38, + #[enumval(39)] + ShoeRack = 39, + #[enumval(40)] + Shower = 40, + #[enumval(41)] + SideDoor = 41, + #[enumval(42)] + Sink = 42, + #[enumval(43)] + Sofa = 43, + #[enumval(44)] + Stove = 44, + #[enumval(45)] + Table = 45, + #[enumval(46)] + Toilet = 46, + #[enumval(47)] + TrashCan = 47, + #[enumval(48)] + LaundryWasher = 48, + #[enumval(49)] + Window = 49, + #[enumval(50)] + WineCooler = 50, } #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] - pub enum CurrencyStructTag { Currency = 0, DecimalPoints = 1 } + pub enum CurrencyStructTag { + Currency = 0, + DecimalPoints = 1, + } #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] - pub enum PriceStructTag { Amount = 0, Currency = 1 } + pub enum PriceStructTag { + Amount = 0, + Currency = 1, + } #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] #[repr(u8)] - pub enum MeasurementAccuracyRangeStructTag { RangeMin = 0, RangeMax = 1, PercentMax = 2, PercentMin = 3, PercentTypical = 4, FixedMax = 5, FixedMin = 6, FixedTypical = 7 } + pub enum MeasurementAccuracyRangeStructTag { + RangeMin = 0, + RangeMax = 1, + PercentMax = 2, + PercentMin = 3, + PercentTypical = 4, + FixedMax = 5, + FixedMin = 6, + FixedTypical = 7, + } #[derive(PartialEq, Eq, Clone, Hash)] - pub struct CurrencyStruct<'a> (rs_matter_crate::tlv::TLVElement<'a>); + pub struct CurrencyStruct<'a>(rs_matter_crate::tlv::TLVElement<'a>); impl<'a> CurrencyStruct<'a> { #[doc = "Create a new instance"] - pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { Self(element) } + pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { + Self(element) + } #[doc = "Return the underlying TLV element"] - pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { &self.0 } - pub fn currency(&self) -> Result { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) } - pub fn decimal_points(&self) -> Result { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) } + pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { + &self.0 + } + pub fn currency(&self) -> Result { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) + } + pub fn decimal_points(&self) -> Result { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) + } + } + impl<'a> rs_matter_crate::tlv::FromTLV<'a> for CurrencyStruct<'a> { + fn from_tlv( + element: &rs_matter_crate::tlv::TLVElement<'a>, + ) -> Result { + Ok(Self::new(element.clone())) + } } - impl<'a> rs_matter_crate::tlv::FromTLV<'a> for CurrencyStruct<'a> { fn from_tlv(element: &rs_matter_crate::tlv::TLVElement<'a>) -> Result { Ok(Self::new(element.clone())) } } impl rs_matter_crate::tlv::ToTLV for CurrencyStruct<'_> { - fn to_tlv(&self, tag: &rs_matter_crate::tlv::TLVTag, tw: W) -> Result<(), rs_matter_crate::error::Error> { self.0.to_tlv(tag, tw) } - fn tlv_iter(&self, tag: rs_matter_crate::tlv::TLVTag) -> impl Iterator> { self.0.tlv_iter(tag) } + fn to_tlv( + &self, + tag: &rs_matter_crate::tlv::TLVTag, + tw: W, + ) -> Result<(), rs_matter_crate::error::Error> { + self.0.to_tlv(tag, tw) + } + fn tlv_iter( + &self, + tag: rs_matter_crate::tlv::TLVTag, + ) -> impl Iterator> + { + self.0.tlv_iter(tag) + } } impl core::fmt::Debug for CurrencyStruct<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { @@ -481,30 +690,73 @@ pub mod globals { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{} {{", "CurrencyStruct"); match self.currency() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "currency", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "currency", e.code()), + Ok(value) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "currency", value) + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "currency", + e.code() + ), } match self.decimal_points() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "decimal_points", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "decimal_points", e.code()), + Ok(value) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: {:?},", + "decimal_points", + value + ), + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "decimal_points", + e.code() + ), } rs_matter_crate::reexport::defmt::write!(f, "}}") } } #[derive(PartialEq, Eq, Clone, Hash)] - pub struct PriceStruct<'a> (rs_matter_crate::tlv::TLVElement<'a>); + pub struct PriceStruct<'a>(rs_matter_crate::tlv::TLVElement<'a>); impl<'a> PriceStruct<'a> { #[doc = "Create a new instance"] - pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { Self(element) } + pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { + Self(element) + } #[doc = "Return the underlying TLV element"] - pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { &self.0 } - pub fn amount(&self) -> Result { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) } - pub fn currency(&self) -> Result, rs_matter_crate::error::Error> { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) } + pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { + &self.0 + } + pub fn amount(&self) -> Result { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) + } + pub fn currency(&self) -> Result, rs_matter_crate::error::Error> { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) + } + } + impl<'a> rs_matter_crate::tlv::FromTLV<'a> for PriceStruct<'a> { + fn from_tlv( + element: &rs_matter_crate::tlv::TLVElement<'a>, + ) -> Result { + Ok(Self::new(element.clone())) + } } - impl<'a> rs_matter_crate::tlv::FromTLV<'a> for PriceStruct<'a> { fn from_tlv(element: &rs_matter_crate::tlv::TLVElement<'a>) -> Result { Ok(Self::new(element.clone())) } } impl rs_matter_crate::tlv::ToTLV for PriceStruct<'_> { - fn to_tlv(&self, tag: &rs_matter_crate::tlv::TLVTag, tw: W) -> Result<(), rs_matter_crate::error::Error> { self.0.to_tlv(tag, tw) } - fn tlv_iter(&self, tag: rs_matter_crate::tlv::TLVTag) -> impl Iterator> { self.0.tlv_iter(tag) } + fn to_tlv( + &self, + tag: &rs_matter_crate::tlv::TLVTag, + tw: W, + ) -> Result<(), rs_matter_crate::error::Error> { + self.0.to_tlv(tag, tw) + } + fn tlv_iter( + &self, + tag: rs_matter_crate::tlv::TLVTag, + ) -> impl Iterator> + { + self.0.tlv_iter(tag) + } } impl core::fmt::Debug for PriceStruct<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { @@ -525,54 +777,124 @@ pub mod globals { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{} {{", "PriceStruct"); match self.amount() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "amount", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "amount", e.code()), + Ok(value) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "amount", value) + } + Err(e) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "amount", e.code()) + } } match self.currency() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "currency", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "currency", e.code()), + Ok(value) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "currency", value) + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "currency", + e.code() + ), } rs_matter_crate::reexport::defmt::write!(f, "}}") } } #[derive(PartialEq, Eq, Clone, Hash)] - pub struct MeasurementAccuracyRangeStruct<'a> (rs_matter_crate::tlv::TLVElement<'a>); + pub struct MeasurementAccuracyRangeStruct<'a>(rs_matter_crate::tlv::TLVElement<'a>); impl<'a> MeasurementAccuracyRangeStruct<'a> { #[doc = "Create a new instance"] - pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { Self(element) } + pub const fn new(element: rs_matter_crate::tlv::TLVElement<'a>) -> Self { + Self(element) + } #[doc = "Return the underlying TLV element"] - pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { &self.0 } - pub fn range_min(&self) -> Result { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) } - pub fn range_max(&self) -> Result { rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) } - pub fn percent_max(&self) -> Result, rs_matter_crate::error::Error> { + pub const fn tlv_element(&self) -> &rs_matter_crate::tlv::TLVElement<'a> { + &self.0 + } + pub fn range_min(&self) -> Result { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(0)?) + } + pub fn range_max(&self) -> Result { + rs_matter_crate::tlv::FromTLV::from_tlv(&self.0.structure()?.ctx(1)?) + } + pub fn percent_max( + &self, + ) -> Result, rs_matter_crate::error::Error> + { let element = self.0.structure()?.find_ctx(2)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } } - pub fn percent_min(&self) -> Result, rs_matter_crate::error::Error> { + pub fn percent_min( + &self, + ) -> Result, rs_matter_crate::error::Error> + { let element = self.0.structure()?.find_ctx(3)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } } - pub fn percent_typical(&self) -> Result, rs_matter_crate::error::Error> { + pub fn percent_typical( + &self, + ) -> Result, rs_matter_crate::error::Error> + { let element = self.0.structure()?.find_ctx(4)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } } pub fn fixed_max(&self) -> Result, rs_matter_crate::error::Error> { let element = self.0.structure()?.find_ctx(5)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } } pub fn fixed_min(&self) -> Result, rs_matter_crate::error::Error> { let element = self.0.structure()?.find_ctx(6)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } } pub fn fixed_typical(&self) -> Result, rs_matter_crate::error::Error> { let element = self.0.structure()?.find_ctx(7)?; - if element.is_empty() { Ok(None) } else { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } + if element.is_empty() { + Ok(None) + } else { + Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) + } + } + } + impl<'a> rs_matter_crate::tlv::FromTLV<'a> for MeasurementAccuracyRangeStruct<'a> { + fn from_tlv( + element: &rs_matter_crate::tlv::TLVElement<'a>, + ) -> Result { + Ok(Self::new(element.clone())) } } - impl<'a> rs_matter_crate::tlv::FromTLV<'a> for MeasurementAccuracyRangeStruct<'a> { fn from_tlv(element: &rs_matter_crate::tlv::TLVElement<'a>) -> Result { Ok(Self::new(element.clone())) } } impl rs_matter_crate::tlv::ToTLV for MeasurementAccuracyRangeStruct<'_> { - fn to_tlv(&self, tag: &rs_matter_crate::tlv::TLVTag, tw: W) -> Result<(), rs_matter_crate::error::Error> { self.0.to_tlv(tag, tw) } - fn tlv_iter(&self, tag: rs_matter_crate::tlv::TLVTag) -> impl Iterator> { self.0.tlv_iter(tag) } + fn to_tlv( + &self, + tag: &rs_matter_crate::tlv::TLVTag, + tw: W, + ) -> Result<(), rs_matter_crate::error::Error> { + self.0.to_tlv(tag, tw) + } + fn tlv_iter( + &self, + tag: rs_matter_crate::tlv::TLVTag, + ) -> impl Iterator> + { + self.0.tlv_iter(tag) + } } impl core::fmt::Debug for MeasurementAccuracyRangeStruct<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { @@ -623,90 +945,242 @@ pub mod globals { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{} {{", "MeasurementAccuracyRangeStruct"); match self.range_min() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "range_min", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "range_min", e.code()), + Ok(value) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "range_min", value) + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "range_min", + e.code() + ), } match self.range_max() { - Ok(value) => rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "range_max", value), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "range_max", e.code()), + Ok(value) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: {:?},", "range_max", value) + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "range_max", + e.code() + ), } match self.percent_max() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "percent_max", value), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "percent_max", + value + ), Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "percent_max"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "percent_max", e.code()), + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "percent_max", + e.code() + ), } match self.percent_min() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "percent_min", value), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "percent_min", + value + ), Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "percent_min"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "percent_min", e.code()), + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "percent_min", + e.code() + ), } match self.percent_typical() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "percent_typical", value), - Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "percent_typical"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "percent_typical", e.code()), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "percent_typical", + value + ), + Ok(None) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "percent_typical") + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "percent_typical", + e.code() + ), } match self.fixed_max() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "fixed_max", value), - Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "fixed_max"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "fixed_max", e.code()), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "fixed_max", + value + ), + Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "fixed_max"), + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "fixed_max", + e.code() + ), } match self.fixed_min() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "fixed_min", value), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "fixed_min", + value + ), Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "fixed_min"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "fixed_min", e.code()), + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "fixed_min", + e.code() + ), } match self.fixed_typical() { - Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!(f, "{}: Some({:?}),", "fixed_typical", value), - Ok(None) => rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "fixed_typical"), - Err(e) => rs_matter_crate::reexport::defmt::write!(f, "{}: ??? {:?},", "fixed_typical", e.code()), + Ok(Some(value)) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: Some({:?}),", + "fixed_typical", + value + ), + Ok(None) => { + rs_matter_crate::reexport::defmt::write!(f, "{}: None,", "fixed_typical") + } + Err(e) => rs_matter_crate::reexport::defmt::write!( + f, + "{}: ??? {:?},", + "fixed_typical", + e.code() + ), } rs_matter_crate::reexport::defmt::write!(f, "}}") } } - pub struct CurrencyStructBuilder (P); - impl

CurrencyStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + pub struct CurrencyStructBuilder(P); + impl

CurrencyStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { use rs_matter_crate::tlv::TLVWrite; parent.writer().start_struct(tag)?; Ok(Self(parent)) } } #[cfg(feature = "defmt")] - impl

CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn currency(mut self, value: u16) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "currency" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "currency" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; + impl

CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn currency( + mut self, + value: u16, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "currency", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "currency", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(CurrencyStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn currency(mut self, value: u16) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "currency" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; + impl

CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn currency( + mut self, + value: u16, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "currency", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(CurrencyStructBuilder(self.0)) } } #[cfg(feature = "defmt")] - impl

CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn decimal_points(mut self, value: u8) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "decimalPoints" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "decimalPoints" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(1), self.0.writer())?; + impl

CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn decimal_points( + mut self, + value: u8, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!( + "{:?}::{} -> {:?} +", + self, + "decimalPoints", + value + ); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "decimalPoints", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(1), + self.0.writer(), + )?; Ok(CurrencyStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn decimal_points(mut self, value: u8) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "decimalPoints" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(1), self.0.writer())?; + impl

CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn decimal_points( + mut self, + value: u8, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "decimalPoints", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(1), + self.0.writer(), + )?; Ok(CurrencyStructBuilder(self.0)) } } - impl

CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { + impl

CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { #[doc = "Finish the struct and return the parent"] pub fn end(mut self) -> Result { use rs_matter_crate::tlv::TLVWrite; @@ -714,27 +1188,72 @@ pub mod globals { Ok(self.0) } } - impl core::fmt::Debug for CurrencyStructBuilder where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "CurrencyStruct") } } + impl core::fmt::Debug for CurrencyStructBuilder + where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "CurrencyStruct") + } + } #[cfg(feature = "defmt")] - impl rs_matter_crate::reexport::defmt::Format for CurrencyStructBuilder where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "CurrencyStruct") } } - impl rs_matter_crate::tlv::TLVBuilderParent for CurrencyStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { + impl rs_matter_crate::reexport::defmt::Format for CurrencyStructBuilder + where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "CurrencyStruct") + } + } + impl rs_matter_crate::tlv::TLVBuilderParent for CurrencyStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } + fn writer(&mut self) -> &mut P::Write { + self.0.writer() + } } - impl

rs_matter_crate::tlv::TLVBuilder

for CurrencyStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } + impl

rs_matter_crate::tlv::TLVBuilder

for CurrencyStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 + } } - pub struct CurrencyStructArrayBuilder

(P); - impl

CurrencyStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + pub struct CurrencyStructArrayBuilder

(P); + impl

CurrencyStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { use rs_matter_crate::tlv::TLVWrite; parent.writer().start_array(tag)?; Ok(Self(parent)) } #[doc = "Push a new element into the array"] - pub fn push(self) -> Result>, rs_matter_crate::error::Error> { rs_matter_crate::tlv::TLVBuilder::new(CurrencyStructArrayBuilder(self.0), &rs_matter_crate::tlv::TLVTag::Anonymous) } + pub fn push( + self, + ) -> Result< + CurrencyStructBuilder>, + rs_matter_crate::error::Error, + > { + rs_matter_crate::tlv::TLVBuilder::new( + CurrencyStructArrayBuilder(self.0), + &rs_matter_crate::tlv::TLVTag::Anonymous, + ) + } #[doc = "Finish the array and return the parent"] pub fn end(mut self) -> Result { use rs_matter_crate::tlv::TLVWrite; @@ -742,265 +1261,732 @@ pub mod globals { Ok(self.0) } } - impl

core::fmt::Debug for CurrencyStructArrayBuilder

where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "CurrencyStruct[]") } } + impl

core::fmt::Debug for CurrencyStructArrayBuilder

+ where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "CurrencyStruct[]") + } + } #[cfg(feature = "defmt")] - impl

rs_matter_crate::reexport::defmt::Format for CurrencyStructArrayBuilder

where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "CurrencyStruct[]") } } - impl

rs_matter_crate::tlv::TLVBuilderParent for CurrencyStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + impl

rs_matter_crate::reexport::defmt::Format for CurrencyStructArrayBuilder

+ where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "CurrencyStruct[]") + } + } + impl

rs_matter_crate::tlv::TLVBuilderParent for CurrencyStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } + fn writer(&mut self) -> &mut P::Write { + self.0.writer() + } } - impl

rs_matter_crate::tlv::TLVBuilder

for CurrencyStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } + impl

rs_matter_crate::tlv::TLVBuilder

for CurrencyStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 + } } - pub struct PriceStructBuilder (P); - impl

PriceStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + pub struct PriceStructBuilder(P); + impl

PriceStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { use rs_matter_crate::tlv::TLVWrite; parent.writer().start_struct(tag)?; Ok(Self(parent)) } } #[cfg(feature = "defmt")] - impl

PriceStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn amount(mut self, value: money) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "amount" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "amount" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; + impl

PriceStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn amount( + mut self, + value: rs_matter_crate::im::Money, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "amount", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "amount", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(PriceStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

PriceStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn amount(mut self, value: money) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "amount" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; + impl

PriceStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn amount( + mut self, + value: rs_matter_crate::im::Money, + ) -> Result, rs_matter_crate::error::Error> { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "amount", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(PriceStructBuilder(self.0)) } } - impl

PriceStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { pub fn currency(self) -> Result>, rs_matter_crate::error::Error> { rs_matter_crate::tlv::TLVBuilder::new(PriceStructBuilder(self.0), &rs_matter_crate::tlv::TLVTag::Context(1)) } } - impl

PriceStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { - #[doc = "Finish the struct and return the parent"] - pub fn end(mut self) -> Result { - use rs_matter_crate::tlv::TLVWrite; - self.0.writer().end_container()?; - Ok(self.0) + impl

PriceStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + pub fn currency( + self, + ) -> Result< + CurrencyStructBuilder>, + rs_matter_crate::error::Error, + > { + rs_matter_crate::tlv::TLVBuilder::new( + PriceStructBuilder(self.0), + &rs_matter_crate::tlv::TLVTag::Context(1), + ) } } - impl core::fmt::Debug for PriceStructBuilder where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "PriceStruct") } } - #[cfg(feature = "defmt")] - impl rs_matter_crate::reexport::defmt::Format for PriceStructBuilder where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "PriceStruct") } } - impl rs_matter_crate::tlv::TLVBuilderParent for PriceStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { - type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } - } - impl

rs_matter_crate::tlv::TLVBuilder

for PriceStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } - } - pub struct PriceStructArrayBuilder

(P); - impl

PriceStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { - use rs_matter_crate::tlv::TLVWrite; - parent.writer().start_array(tag)?; - Ok(Self(parent)) - } - #[doc = "Push a new element into the array"] - pub fn push(self) -> Result>, rs_matter_crate::error::Error> { rs_matter_crate::tlv::TLVBuilder::new(PriceStructArrayBuilder(self.0), &rs_matter_crate::tlv::TLVTag::Anonymous) } - #[doc = "Finish the array and return the parent"] + impl

PriceStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + #[doc = "Finish the struct and return the parent"] pub fn end(mut self) -> Result { use rs_matter_crate::tlv::TLVWrite; self.0.writer().end_container()?; Ok(self.0) } } - impl

core::fmt::Debug for PriceStructArrayBuilder

where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "PriceStruct[]") } } - #[cfg(feature = "defmt")] - impl

rs_matter_crate::reexport::defmt::Format for PriceStructArrayBuilder

where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "PriceStruct[]") } } - impl

rs_matter_crate::tlv::TLVBuilderParent for PriceStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } - } - impl

rs_matter_crate::tlv::TLVBuilder

for PriceStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } - } - pub struct MeasurementAccuracyRangeStructBuilder (P); - impl

MeasurementAccuracyRangeStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { - use rs_matter_crate::tlv::TLVWrite; - parent.writer().start_struct(tag)?; - Ok(Self(parent)) + impl core::fmt::Debug for PriceStructBuilder + where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "PriceStruct") } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn range_min(mut self, value: i64) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "rangeMin" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "rangeMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + impl rs_matter_crate::reexport::defmt::Format for PriceStructBuilder + where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "PriceStruct") } } - #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn range_min(mut self, value: i64) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "rangeMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(0), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + impl rs_matter_crate::tlv::TLVBuilderParent for PriceStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + type Write = P::Write; + fn writer(&mut self) -> &mut P::Write { + self.0.writer() } } - #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn range_max(mut self, value: i64) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "rangeMax" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "rangeMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(1), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + impl

rs_matter_crate::tlv::TLVBuilder

for PriceStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 } } - #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn range_max(mut self, value: i64) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "rangeMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(1), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + pub struct PriceStructArrayBuilder

(P); + impl

PriceStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + #[doc = "Create a new instance"] + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + use rs_matter_crate::tlv::TLVWrite; + parent.writer().start_array(tag)?; + Ok(Self(parent)) + } + #[doc = "Push a new element into the array"] + pub fn push( + self, + ) -> Result>, rs_matter_crate::error::Error> + { + rs_matter_crate::tlv::TLVBuilder::new( + PriceStructArrayBuilder(self.0), + &rs_matter_crate::tlv::TLVTag::Anonymous, + ) + } + #[doc = "Finish the array and return the parent"] + pub fn end(mut self) -> Result { + use rs_matter_crate::tlv::TLVWrite; + self.0.writer().end_container()?; + Ok(self.0) + } + } + impl

core::fmt::Debug for PriceStructArrayBuilder

+ where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "PriceStruct[]") } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn percent_max(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "percentMax" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(2), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + impl

rs_matter_crate::reexport::defmt::Format for PriceStructArrayBuilder

+ where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "PriceStruct[]") } } - #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn percent_max(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(2), self.0.writer())?; - Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + impl

rs_matter_crate::tlv::TLVBuilderParent for PriceStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + type Write = P::Write; + fn writer(&mut self) -> &mut P::Write { + self.0.writer() + } + } + impl

rs_matter_crate::tlv::TLVBuilder

for PriceStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 + } + } + pub struct MeasurementAccuracyRangeStructBuilder(P); + impl

MeasurementAccuracyRangeStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + #[doc = "Create a new instance"] + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + use rs_matter_crate::tlv::TLVWrite; + parent.writer().start_struct(tag)?; + Ok(Self(parent)) } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn percent_min(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "percentMin" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(3), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn range_min( + mut self, + value: i64, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "rangeMin", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "rangeMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn percent_min(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(3), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn range_min( + mut self, + value: i64, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "rangeMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(0), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn percent_typical(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "percentTypical" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentTypical" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(4), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn range_max( + mut self, + value: i64, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "rangeMax", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "rangeMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(1), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn percent_typical(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "percentTypical" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(4), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn range_max( + mut self, + value: i64, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "rangeMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(1), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn fixed_max(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "fixedMax" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(5), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn percent_max( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!( + "{:?}::{} -> {:?} +", + self, + "percentMax", + value + ); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "percentMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(2), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn fixed_max(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedMax" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(5), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn percent_max( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "percentMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(2), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn fixed_min(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "fixedMin" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(6), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn percent_min( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!( + "{:?}::{} -> {:?} +", + self, + "percentMin", + value + ); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "percentMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(3), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn fixed_min(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedMin" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(6), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn percent_min( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "percentMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(3), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(feature = "defmt")] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug + rs_matter_crate::reexport::defmt::Format, { - pub fn fixed_typical(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +" , self , "fixedTypical" , value); - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedTypical" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(7), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn percent_typical( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!( + "{:?}::{} -> {:?} +", + self, + "percentTypical", + value + ); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "percentTypical", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(4), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } #[cfg(not(feature = "defmt"))] - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, { - pub fn fixed_typical(mut self, value: Option) -> Result, rs_matter_crate::error::Error> { - #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +" , self , "fixedTypical" , value); - rs_matter_crate::tlv::ToTLV::to_tlv(&value, &rs_matter_crate::tlv::TLVTag::Context(7), self.0.writer())?; + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn percent_typical( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "percentTypical", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(4), + self.0.writer(), + )?; Ok(MeasurementAccuracyRangeStructBuilder(self.0)) } } - impl

MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { - #[doc = "Finish the struct and return the parent"] - pub fn end(mut self) -> Result { - use rs_matter_crate::tlv::TLVWrite; - self.0.writer().end_container()?; + #[cfg(feature = "defmt")] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn fixed_max( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "fixedMax", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "fixedMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(5), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + #[cfg(not(feature = "defmt"))] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn fixed_max( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "fixedMax", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(5), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + #[cfg(feature = "defmt")] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn fixed_min( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!("{:?}::{} -> {:?} +", self, "fixedMin", value); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "fixedMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(6), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + #[cfg(not(feature = "defmt"))] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn fixed_min( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!("{:?}::{} -> {:?} +", self, "fixedMin", value); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(6), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + #[cfg(feature = "defmt")] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + + core::fmt::Debug + + rs_matter_crate::reexport::defmt::Format, + { + pub fn fixed_typical( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "defmt")] + rs_matter_crate::reexport::defmt::debug!( + "{:?}::{} -> {:?} +", + self, + "fixedTypical", + value + ); + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "fixedTypical", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(7), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + #[cfg(not(feature = "defmt"))] + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent + core::fmt::Debug, + { + pub fn fixed_typical( + mut self, + value: Option, + ) -> Result, rs_matter_crate::error::Error> + { + #[cfg(feature = "log")] + rs_matter_crate::reexport::log::debug!( + "{:?}::{} -> {:?} +", + self, + "fixedTypical", + value + ); + rs_matter_crate::tlv::ToTLV::to_tlv( + &value, + &rs_matter_crate::tlv::TLVTag::Context(7), + self.0.writer(), + )?; + Ok(MeasurementAccuracyRangeStructBuilder(self.0)) + } + } + impl

MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + #[doc = "Finish the struct and return the parent"] + pub fn end(mut self) -> Result { + use rs_matter_crate::tlv::TLVWrite; + self.0.writer().end_container()?; Ok(self.0) } } - impl core::fmt::Debug for MeasurementAccuracyRangeStructBuilder where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct") } } + impl core::fmt::Debug for MeasurementAccuracyRangeStructBuilder + where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct") + } + } #[cfg(feature = "defmt")] - impl rs_matter_crate::reexport::defmt::Format for MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct") } } - impl rs_matter_crate::tlv::TLVBuilderParent for MeasurementAccuracyRangeStructBuilder where P: rs_matter_crate::tlv::TLVBuilderParent, { + impl rs_matter_crate::reexport::defmt::Format + for MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!( + f, + "{:?}::{}", + self.0, + "MeasurementAccuracyRangeStruct" + ) + } + } + impl rs_matter_crate::tlv::TLVBuilderParent + for MeasurementAccuracyRangeStructBuilder + where + P: rs_matter_crate::tlv::TLVBuilderParent, + { type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } + fn writer(&mut self) -> &mut P::Write { + self.0.writer() + } } - impl

rs_matter_crate::tlv::TLVBuilder

for MeasurementAccuracyRangeStructBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } + impl

rs_matter_crate::tlv::TLVBuilder

for MeasurementAccuracyRangeStructBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 + } } - pub struct MeasurementAccuracyRangeStructArrayBuilder

(P); - impl

MeasurementAccuracyRangeStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + pub struct MeasurementAccuracyRangeStructArrayBuilder

(P); + impl

MeasurementAccuracyRangeStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { #[doc = "Create a new instance"] - pub fn new(mut parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { + pub fn new( + mut parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { use rs_matter_crate::tlv::TLVWrite; parent.writer().start_array(tag)?; Ok(Self(parent)) } #[doc = "Push a new element into the array"] - pub fn push(self) -> Result>, rs_matter_crate::error::Error> { rs_matter_crate::tlv::TLVBuilder::new(MeasurementAccuracyRangeStructArrayBuilder(self.0), &rs_matter_crate::tlv::TLVTag::Anonymous) } + pub fn push( + self, + ) -> Result< + MeasurementAccuracyRangeStructBuilder>, + rs_matter_crate::error::Error, + > { + rs_matter_crate::tlv::TLVBuilder::new( + MeasurementAccuracyRangeStructArrayBuilder(self.0), + &rs_matter_crate::tlv::TLVTag::Anonymous, + ) + } #[doc = "Finish the array and return the parent"] pub fn end(mut self) -> Result { use rs_matter_crate::tlv::TLVWrite; @@ -1008,16 +1994,50 @@ pub mod globals { Ok(self.0) } } - impl

core::fmt::Debug for MeasurementAccuracyRangeStructArrayBuilder

where P: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct[]") } } + impl

core::fmt::Debug for MeasurementAccuracyRangeStructArrayBuilder

+ where + P: core::fmt::Debug, + { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct[]") + } + } #[cfg(feature = "defmt")] - impl

rs_matter_crate::reexport::defmt::Format for MeasurementAccuracyRangeStructArrayBuilder

where P: rs_matter_crate::reexport::defmt::Format, { fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { rs_matter_crate::reexport::defmt::write!(f, "{:?}::{}", self.0, "MeasurementAccuracyRangeStruct[]") } } - impl

rs_matter_crate::tlv::TLVBuilderParent for MeasurementAccuracyRangeStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { + impl

rs_matter_crate::reexport::defmt::Format for MeasurementAccuracyRangeStructArrayBuilder

+ where + P: rs_matter_crate::reexport::defmt::Format, + { + fn format(&self, f: rs_matter_crate::reexport::defmt::Formatter<'_>) { + rs_matter_crate::reexport::defmt::write!( + f, + "{:?}::{}", + self.0, + "MeasurementAccuracyRangeStruct[]" + ) + } + } + impl

rs_matter_crate::tlv::TLVBuilderParent for MeasurementAccuracyRangeStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { type Write = P::Write; - fn writer(&mut self) -> &mut P::Write { self.0.writer() } + fn writer(&mut self) -> &mut P::Write { + self.0.writer() + } } - impl

rs_matter_crate::tlv::TLVBuilder

for MeasurementAccuracyRangeStructArrayBuilder

where P: rs_matter_crate::tlv::TLVBuilderParent, { - fn new(parent: P, tag: &rs_matter_crate::tlv::TLVTag) -> Result { Self::new(parent, tag) } - fn unchecked_into_parent(self) -> P { self.0 } + impl

rs_matter_crate::tlv::TLVBuilder

for MeasurementAccuracyRangeStructArrayBuilder

+ where + P: rs_matter_crate::tlv::TLVBuilderParent, + { + fn new( + parent: P, + tag: &rs_matter_crate::tlv::TLVTag, + ) -> Result { + Self::new(parent, tag) + } + fn unchecked_into_parent(self) -> P { + self.0 + } } } "#; @@ -1659,7 +2679,10 @@ pub mod unit_testing { Ok(Some(rs_matter_crate::tlv::FromTLV::from_tlv(&element)?)) } } - pub fn fabric_index(&self) -> Result, rs_matter_crate::error::Error> { + pub fn fabric_index( + &self, + ) -> Result, rs_matter_crate::error::Error> + { let element = self.0.structure()?.find_ctx(254)?; if element.is_empty() { Ok(None) @@ -7516,7 +8539,7 @@ pub mod unit_testing { { pub fn fabric_index( mut self, - value: Option, + value: Option, ) -> Result, rs_matter_crate::error::Error> { #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( @@ -7547,7 +8570,7 @@ pub mod unit_testing { { pub fn fabric_index( mut self, - value: Option, + value: Option, ) -> Result, rs_matter_crate::error::Error> { #[cfg(feature = "log")] rs_matter_crate::reexport::log::debug!( @@ -21755,116 +22778,1913 @@ pub mod unit_testing { #[doc = "A helper struct to generate the cluster debug info."] struct MetadataDebug(pub T); #[doc = "The handler trait for the cluster."] - pub trait ClusterHandler { + pub trait ClusterSyncHandler { + fn boolean( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn boolean (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn bitmap_8( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn bitmap_8 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn bitmap_16( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn bitmap_16 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn bitmap_32( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn bitmap_32 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn bitmap_64( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn bitmap_64 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_8_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_16_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_16_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_24_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_24_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_32_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_32_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_40_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_40_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_48_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_48_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_56_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_56_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_64_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_64_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_8_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_8_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_16_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_16_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_24_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_24_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_32_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_32_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_40_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_40_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_48_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_48_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_56_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_56_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn int_64_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn int_64_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn enum_8( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn enum_8 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn enum_16( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn enum_16 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn float_single( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn float_single (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn float_double( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn float_double (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::OctetsBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: OctetsBuilder < P >)"); + } + } + fn list_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + rs_matter_crate::tlv::ToTLVArrayBuilder, + rs_matter_crate::tlv::ToTLVBuilder, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_int_8_u < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < rs_matter_crate :: tlv :: ToTLVArrayBuilder < P , u8 > , rs_matter_crate :: tlv :: ToTLVBuilder < P , u8 > >)"); + } + } + fn list_octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + rs_matter_crate::tlv::OctetsArrayBuilder

, + rs_matter_crate::tlv::OctetsBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < rs_matter_crate :: tlv :: OctetsArrayBuilder < P > , rs_matter_crate :: tlv :: OctetsBuilder < P > >)"); + } + } + fn list_struct_octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + TestListStructOctetArrayBuilder

, + TestListStructOctetBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_struct_octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < TestListStructOctetArrayBuilder < P > , TestListStructOctetBuilder < P > >)"); + } + } + fn long_octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::OctetsBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn long_octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: OctetsBuilder < P >)"); + } + } + fn char_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::Utf8StrBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn char_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: Utf8StrBuilder < P >)"); + } + } + fn long_char_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::Utf8StrBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn long_char_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: Utf8StrBuilder < P >)"); + } + } + fn epoch_us( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn epoch_us (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn epoch_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn epoch_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn vendor_id( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn vendor_id (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn list_nullables_and_optionals_struct( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + NullablesAndOptionalsStructArrayBuilder

, + NullablesAndOptionalsStructBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_nullables_and_optionals_struct < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < NullablesAndOptionalsStructArrayBuilder < P > , NullablesAndOptionalsStructBuilder < P > >)"); + } + } + fn enum_attr( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn enum_attr (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn struct_attr( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: SimpleStructBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn struct_attr < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : SimpleStructBuilder < P >)"); + } + } + fn range_restricted_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn range_restricted_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn range_restricted_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn range_restricted_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn range_restricted_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn range_restricted_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn range_restricted_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn range_restricted_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn list_long_octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + rs_matter_crate::tlv::OctetsArrayBuilder

, + rs_matter_crate::tlv::OctetsBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_long_octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < rs_matter_crate :: tlv :: OctetsArrayBuilder < P > , rs_matter_crate :: tlv :: OctetsBuilder < P > >)"); + } + } + fn list_fabric_scoped( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::dm::ArrayAttributeRead< + TestFabricScopedArrayBuilder

, + TestFabricScopedBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn list_fabric_scoped < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: dm :: ArrayAttributeRead < TestFabricScopedArrayBuilder < P > , TestFabricScopedBuilder < P > >)"); + } + } + fn timed_write_boolean( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn timed_write_boolean (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn general_error_boolean( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn general_error_boolean (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn cluster_error_boolean( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn cluster_error_boolean (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn unsupported( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + } + fn nullable_boolean( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_boolean (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_bitmap_8( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> + { + const { + core :: panic ! ("You must implement fn nullable_bitmap_8 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_bitmap_16( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> + { + const { + core :: panic ! ("You must implement fn nullable_bitmap_16 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_bitmap_32( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> + { + const { + core :: panic ! ("You must implement fn nullable_bitmap_32 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_bitmap_64( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> + { + const { + core :: panic ! ("You must implement fn nullable_bitmap_64 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_24_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_24_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_32_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_32_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_40_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_40_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_48_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_48_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_56_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_56_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_64_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_64_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_24_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_24_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_32_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_32_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_40_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_40_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_48_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_48_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_56_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_56_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_int_64_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_int_64_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_enum_8( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_enum_8 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_enum_16( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_enum_16 (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_float_single( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_float_single (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_float_double( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_float_double (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_octet_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::NullableBuilder< + P, + rs_matter_crate::tlv::OctetsBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn nullable_octet_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: NullableBuilder < P , rs_matter_crate :: tlv :: OctetsBuilder < P > >)"); + } + } + fn nullable_char_string( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::NullableBuilder< + P, + rs_matter_crate::tlv::Utf8StrBuilder

, + >, + ) -> Result { + const { + core :: panic ! ("You must implement fn nullable_char_string < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: NullableBuilder < P , rs_matter_crate :: tlv :: Utf8StrBuilder < P > >)"); + } + } + fn nullable_enum_attr( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> + { + const { + core :: panic ! ("You must implement fn nullable_enum_attr (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_struct( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + builder: rs_matter_crate::tlv::NullableBuilder>, + ) -> Result { + const { + core :: panic ! ("You must implement fn nullable_struct < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: ReadContext , builder : rs_matter_crate :: tlv :: NullableBuilder < P , SimpleStructBuilder < P > >)"); + } + } + fn nullable_range_restricted_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_range_restricted_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_range_restricted_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_range_restricted_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_range_restricted_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_range_restricted_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn nullable_range_restricted_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result, rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn nullable_range_restricted_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn write_only_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + } + fn mei_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> Result { + const { + core :: panic ! ("You must implement fn mei_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } + } + fn set_boolean( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: bool, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_boolean (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : bool)"); + } + } + fn set_bitmap_8( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: Bitmap8MaskMap, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_bitmap_8 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : Bitmap8MaskMap)"); + } + } + fn set_bitmap_16( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: Bitmap16MaskMap, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_bitmap_16 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : Bitmap16MaskMap)"); + } + } + fn set_bitmap_32( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: Bitmap32MaskMap, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_bitmap_32 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : Bitmap32MaskMap)"); + } + } + fn set_bitmap_64( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: Bitmap64MaskMap, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_bitmap_64 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : Bitmap64MaskMap)"); + } + } + fn set_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u8)"); + } + } + fn set_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u16)"); + } + } + fn set_int_24_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_24_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u32)"); + } + } + fn set_int_32_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_32_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u32)"); + } + } + fn set_int_40_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_40_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u64)"); + } + } + fn set_int_48_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_48_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u64)"); + } + } + fn set_int_56_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_56_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u64)"); + } + } + fn set_int_64_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_64_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u64)"); + } + } + fn set_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i8)"); + } + } + fn set_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i16)"); + } + } + fn set_int_24_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_24_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i32)"); + } + } + fn set_int_32_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_32_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i32)"); + } + } + fn set_int_40_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_40_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i64)"); + } + } + fn set_int_48_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_48_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i64)"); + } + } + fn set_int_56_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_56_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i64)"); + } + } + fn set_int_64_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_int_64_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i64)"); + } + } + fn set_enum_8( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_enum_8 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u8)"); + } + } + fn set_enum_16( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_enum_16 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u16)"); + } + } + fn set_float_single( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: f32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_float_single (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : f32)"); + } + } + fn set_float_double( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: f64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_float_double (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : f64)"); + } + } + fn set_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::OctetStr<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: OctetStr < '_ >)"); + } + } + fn set_list_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, u8>, + u8, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , u8 > , u8 >)"); + } + } + fn set_list_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, + rs_matter_crate::tlv::OctetStr<'_>, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , rs_matter_crate :: tlv :: OctetStr < '_ > > , rs_matter_crate :: tlv :: OctetStr < '_ > >)"); + } + } + fn set_list_struct_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, TestListStructOctet<'_>>, + TestListStructOctet<'_>, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_struct_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , TestListStructOctet < '_ > > , TestListStructOctet < '_ > >)"); + } + } + fn set_long_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::OctetStr<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_long_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: OctetStr < '_ >)"); + } + } + fn set_char_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Utf8Str<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_char_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Utf8Str < '_ >)"); + } + } + fn set_long_char_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Utf8Str<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_long_char_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Utf8Str < '_ >)"); + } + } + fn set_epoch_us( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u64, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_epoch_us (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u64)"); + } + } + fn set_epoch_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u32, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_epoch_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u32)"); + } + } + fn set_vendor_id( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_vendor_id (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u16)"); + } + } + fn set_list_nullables_and_optionals_struct( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, NullablesAndOptionalsStruct<'_>>, + NullablesAndOptionalsStruct<'_>, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_nullables_and_optionals_struct (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , NullablesAndOptionalsStruct < '_ > > , NullablesAndOptionalsStruct < '_ > >)"); + } + } + fn set_enum_attr( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: SimpleEnum, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_enum_attr (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : SimpleEnum)"); + } + } + fn set_struct_attr( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: SimpleStruct<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_struct_attr (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : SimpleStruct < '_ >)"); + } + } + fn set_range_restricted_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_range_restricted_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u8)"); + } + } + fn set_range_restricted_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_range_restricted_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i8)"); + } + } + fn set_range_restricted_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_range_restricted_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u16)"); + } + } + fn set_range_restricted_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: i16, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_range_restricted_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : i16)"); + } + } + fn set_list_long_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, + rs_matter_crate::tlv::OctetStr<'_>, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_long_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , rs_matter_crate :: tlv :: OctetStr < '_ > > , rs_matter_crate :: tlv :: OctetStr < '_ > >)"); + } + } + fn set_list_fabric_scoped( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::dm::ArrayAttributeWrite< + rs_matter_crate::tlv::TLVArray<'_, TestFabricScoped<'_>>, + TestFabricScoped<'_>, + >, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_list_fabric_scoped (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: dm :: ArrayAttributeWrite < rs_matter_crate :: tlv :: TLVArray < '_ , TestFabricScoped < '_ > > , TestFabricScoped < '_ > >)"); + } + } + fn set_timed_write_boolean( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: bool, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_timed_write_boolean (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : bool)"); + } + } + fn set_general_error_boolean( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: bool, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_general_error_boolean (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : bool)"); + } + } + fn set_cluster_error_boolean( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: bool, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_cluster_error_boolean (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : bool)"); + } + } + fn set_unsupported( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: bool, + ) -> Result<(), rs_matter_crate::error::Error> { + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + } + fn set_nullable_boolean( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_boolean (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < bool >)"); + } + } + fn set_nullable_bitmap_8( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_bitmap_8 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < Bitmap8MaskMap >)"); + } + } + fn set_nullable_bitmap_16( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_bitmap_16 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < Bitmap16MaskMap >)"); + } + } + fn set_nullable_bitmap_32( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_bitmap_32 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < Bitmap32MaskMap >)"); + } + } + fn set_nullable_bitmap_64( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_bitmap_64 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < Bitmap64MaskMap >)"); + } + } + fn set_nullable_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u8 >)"); + } + } + fn set_nullable_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u16 >)"); + } + } + fn set_nullable_int_24_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_24_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u32 >)"); + } + } + fn set_nullable_int_32_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_32_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u32 >)"); + } + } + fn set_nullable_int_40_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_40_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u64 >)"); + } + } + fn set_nullable_int_48_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_48_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u64 >)"); + } + } + fn set_nullable_int_56_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_56_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u64 >)"); + } + } + fn set_nullable_int_64_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_64_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u64 >)"); + } + } + fn set_nullable_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i8 >)"); + } + } + fn set_nullable_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i16 >)"); + } + } + fn set_nullable_int_24_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_24_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i32 >)"); + } + } + fn set_nullable_int_32_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_32_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i32 >)"); + } + } + fn set_nullable_int_40_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_40_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i64 >)"); + } + } + fn set_nullable_int_48_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_48_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i64 >)"); + } + } + fn set_nullable_int_56_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_56_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i64 >)"); + } + } + fn set_nullable_int_64_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_int_64_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i64 >)"); + } + } + fn set_nullable_enum_8( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_enum_8 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u8 >)"); + } + } + fn set_nullable_enum_16( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_enum_16 (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u16 >)"); + } + } + fn set_nullable_float_single( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_float_single (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < f32 >)"); + } + } + fn set_nullable_float_double( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_float_double (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < f64 >)"); + } + } + fn set_nullable_octet_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_octet_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < rs_matter_crate :: tlv :: OctetStr < '_ > >)"); + } + } + fn set_nullable_char_string( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_char_string (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < rs_matter_crate :: tlv :: Utf8Str < '_ > >)"); + } + } + fn set_nullable_enum_attr( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_enum_attr (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < SimpleEnum >)"); + } + } + fn set_nullable_struct( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_struct (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < SimpleStruct < '_ > >)"); + } + } + fn set_nullable_range_restricted_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_range_restricted_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u8 >)"); + } + } + fn set_nullable_range_restricted_int_8_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_range_restricted_int_8_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i8 >)"); + } + } + fn set_nullable_range_restricted_int_16_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_range_restricted_int_16_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < u16 >)"); + } + } + fn set_nullable_range_restricted_int_16_s( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_nullable_range_restricted_int_16_s (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : rs_matter_crate :: tlv :: Nullable < i16 >)"); + } + } + fn set_write_only_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u8, + ) -> Result<(), rs_matter_crate::error::Error> { + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + } + fn set_mei_int_8_u( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u8, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn set_mei_int_8_u (& self , ctx : impl rs_matter_crate :: dm :: WriteContext , value : u8)"); + } + } + fn handle_test( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn handle_test (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } + } + fn handle_test_not_handled( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn handle_test_not_handled (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } + } + fn handle_test_specific( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + response: TestSpecificResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_specific < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , response : TestSpecificResponseBuilder < P > ,)"); + } + } + fn handle_test_unknown_command( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn handle_test_unknown_command (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } + } + fn handle_test_add_arguments( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestAddArgumentsRequest<'_>, + response: TestAddArgumentsResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_add_arguments < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestAddArgumentsRequest < '_ > , response : TestAddArgumentsResponseBuilder < P > ,)"); + } + } + fn handle_test_simple_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestSimpleArgumentRequestRequest<'_>, + response: TestSimpleArgumentResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_simple_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestSimpleArgumentRequestRequest < '_ > , response : TestSimpleArgumentResponseBuilder < P > ,)"); + } + } + fn handle_test_struct_array_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestStructArrayArgumentRequestRequest<'_>, + response: TestStructArrayArgumentResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_struct_array_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestStructArrayArgumentRequestRequest < '_ > , response : TestStructArrayArgumentResponseBuilder < P > ,)"); + } + } + fn handle_test_struct_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestStructArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_struct_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestStructArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_nested_struct_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestNestedStructArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_nested_struct_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestNestedStructArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_list_struct_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestListStructArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_list_struct_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestListStructArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_list_int_8_u_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestListInt8UArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_list_int_8_u_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestListInt8UArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_nested_struct_list_argument_request< + P: rs_matter_crate::tlv::TLVBuilderParent, + >( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestNestedStructListArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_nested_struct_list_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestNestedStructListArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_list_nested_struct_list_argument_request< + P: rs_matter_crate::tlv::TLVBuilderParent, + >( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestListNestedStructListArgumentRequestRequest<'_>, + response: BooleanResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_list_nested_struct_list_argument_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestListNestedStructListArgumentRequestRequest < '_ > , response : BooleanResponseBuilder < P > ,)"); + } + } + fn handle_test_list_int_8_u_reverse_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestListInt8UReverseRequestRequest<'_>, + response: TestListInt8UReverseResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_list_int_8_u_reverse_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestListInt8UReverseRequestRequest < '_ > , response : TestListInt8UReverseResponseBuilder < P > ,)"); + } + } + fn handle_test_enums_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestEnumsRequestRequest<'_>, + response: TestEnumsResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_enums_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestEnumsRequestRequest < '_ > , response : TestEnumsResponseBuilder < P > ,)"); + } + } + fn handle_test_nullable_optional_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestNullableOptionalRequestRequest<'_>, + response: TestNullableOptionalResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_nullable_optional_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestNullableOptionalRequestRequest < '_ > , response : TestNullableOptionalResponseBuilder < P > ,)"); + } + } + fn handle_test_complex_nullable_optional_request< + P: rs_matter_crate::tlv::TLVBuilderParent, + >( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestComplexNullableOptionalRequestRequest<'_>, + response: TestComplexNullableOptionalResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_complex_nullable_optional_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestComplexNullableOptionalRequestRequest < '_ > , response : TestComplexNullableOptionalResponseBuilder < P > ,)"); + } + } + fn handle_simple_struct_echo_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: SimpleStructEchoRequestRequest<'_>, + response: SimpleStructResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_simple_struct_echo_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : SimpleStructEchoRequestRequest < '_ > , response : SimpleStructResponseBuilder < P > ,)"); + } + } + fn handle_timed_invoke_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn handle_timed_invoke_request (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } + } + fn handle_test_simple_optional_argument_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestSimpleOptionalArgumentRequestRequest<'_>, + ) -> Result<(), rs_matter_crate::error::Error> { + const { + core :: panic ! ("You must implement fn handle_test_simple_optional_argument_request (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestSimpleOptionalArgumentRequestRequest < '_ > ,)"); + } + } + fn handle_test_emit_test_event_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestEmitTestEventRequestRequest<'_>, + response: TestEmitTestEventResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_emit_test_event_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestEmitTestEventRequestRequest < '_ > , response : TestEmitTestEventResponseBuilder < P > ,)"); + } + } + fn handle_test_emit_test_fabric_scoped_event_request< + P: rs_matter_crate::tlv::TLVBuilderParent, + >( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestEmitTestFabricScopedEventRequestRequest<'_>, + response: TestEmitTestFabricScopedEventResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_emit_test_fabric_scoped_event_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestEmitTestFabricScopedEventRequestRequest < '_ > , response : TestEmitTestFabricScopedEventResponseBuilder < P > ,)"); + } + } + fn handle_test_batch_helper_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestBatchHelperRequestRequest<'_>, + response: TestBatchHelperResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_batch_helper_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestBatchHelperRequestRequest < '_ > , response : TestBatchHelperResponseBuilder < P > ,)"); + } + } + fn handle_test_second_batch_helper_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestSecondBatchHelperRequestRequest<'_>, + response: TestBatchHelperResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_second_batch_helper_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestSecondBatchHelperRequestRequest < '_ > , response : TestBatchHelperResponseBuilder < P > ,)"); + } + } + fn handle_test_different_vendor_mei_request( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: TestDifferentVendorMeiRequestRequest<'_>, + response: TestDifferentVendorMeiResponseBuilder

, + ) -> Result { + const { + core :: panic ! ("You must implement fn handle_test_different_vendor_mei_request < P : rs_matter_crate :: tlv :: TLVBuilderParent > (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : TestDifferentVendorMeiRequestRequest < '_ > , response : TestDifferentVendorMeiResponseBuilder < P > ,)"); + } + } + } + #[doc = "The handler trait for the cluster."] + pub trait ClusterHandler: ClusterSyncHandler { #[doc = "The cluster-metadata corresponding to this handler trait."] const CLUSTER: rs_matter_crate::dm::Cluster<'static>; fn dataver(&self) -> u32; fn dataver_changed(&self); + fn run( + &self, + _ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> { + core::future::pending::>() + } fn boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::boolean(self, ctx)) + } fn bitmap_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::bitmap_8(self, ctx)) + } fn bitmap_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::bitmap_16(self, ctx)) + } fn bitmap_32( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::bitmap_32(self, ctx)) + } fn bitmap_64( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::bitmap_64(self, ctx)) + } fn int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::int_8_u(self, ctx)) + } fn int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_16_u(self, ctx)) + } fn int_24_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_24_u(self, ctx)) + } fn int_32_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_32_u(self, ctx)) + } fn int_40_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_40_u(self, ctx)) + } fn int_48_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_48_u(self, ctx)) + } fn int_56_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_56_u(self, ctx)) + } fn int_64_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_64_u(self, ctx)) + } fn int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::int_8_s(self, ctx)) + } fn int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_16_s(self, ctx)) + } fn int_24_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_24_s(self, ctx)) + } fn int_32_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_32_s(self, ctx)) + } fn int_40_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_40_s(self, ctx)) + } fn int_48_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_48_s(self, ctx)) + } fn int_56_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_56_s(self, ctx)) + } fn int_64_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::int_64_s(self, ctx)) + } fn enum_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::enum_8(self, ctx)) + } fn enum_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::enum_16(self, ctx)) + } fn float_single( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::float_single(self, ctx)) + } fn float_double( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::float_double(self, ctx)) + } fn octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::OctetsBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::octet_string( + self, ctx, builder, + )) + } fn list_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21872,7 +24692,11 @@ pub mod unit_testing { rs_matter_crate::tlv::ToTLVArrayBuilder, rs_matter_crate::tlv::ToTLVBuilder, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::list_int_8_u( + self, ctx, builder, + )) + } fn list_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21880,7 +24704,11 @@ pub mod unit_testing { rs_matter_crate::tlv::OctetsArrayBuilder

, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::list_octet_string( + self, ctx, builder, + )) + } fn list_struct_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21888,34 +24716,59 @@ pub mod unit_testing { TestListStructOctetArrayBuilder

, TestListStructOctetBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::list_struct_octet_string( + self, ctx, builder, + )) + } fn long_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::OctetsBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::long_octet_string( + self, ctx, builder, + )) + } fn char_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::Utf8StrBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::char_string( + self, ctx, builder, + )) + } fn long_char_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::Utf8StrBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::long_char_string( + self, ctx, builder, + )) + } fn epoch_us( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::epoch_us(self, ctx)) + } fn epoch_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::epoch_s(self, ctx)) + } fn vendor_id( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::vendor_id(self, ctx)) + } fn list_nullables_and_optionals_struct( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21923,32 +24776,63 @@ pub mod unit_testing { NullablesAndOptionalsStructArrayBuilder

, NullablesAndOptionalsStructBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::list_nullables_and_optionals_struct( + self, ctx, builder, + ), + ) + } fn enum_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::enum_attr(self, ctx)) + } fn struct_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: SimpleStructBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::struct_attr( + self, ctx, builder, + )) + } fn range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::range_restricted_int_8_u( + self, ctx, + )) + } fn range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::range_restricted_int_8_s( + self, ctx, + )) + } fn range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::range_restricted_int_16_u( + self, ctx, + )) + } fn range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::range_restricted_int_16_s( + self, ctx, + )) + } fn list_long_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21956,7 +24840,11 @@ pub mod unit_testing { rs_matter_crate::tlv::OctetsArrayBuilder

, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::list_long_octet_string( + self, ctx, builder, + )) + } fn list_fabric_scoped( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -21964,125 +24852,259 @@ pub mod unit_testing { TestFabricScopedArrayBuilder

, TestFabricScopedBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::list_fabric_scoped( + self, ctx, builder, + )) + } fn timed_write_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::timed_write_boolean(self, ctx)) + } fn general_error_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::general_error_boolean( + self, ctx, + )) + } fn cluster_error_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::cluster_error_boolean( + self, ctx, + )) + } fn unsupported( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::unsupported(self, ctx)) } fn nullable_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_boolean(self, ctx)) + } fn nullable_bitmap_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + core::future::ready(::nullable_bitmap_8(self, ctx)) + } fn nullable_bitmap_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + core::future::ready(::nullable_bitmap_16(self, ctx)) + } fn nullable_bitmap_32( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + core::future::ready(::nullable_bitmap_32(self, ctx)) + } fn nullable_bitmap_64( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + core::future::ready(::nullable_bitmap_64(self, ctx)) + } fn nullable_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_8_u(self, ctx)) + } fn nullable_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_16_u(self, ctx)) + } fn nullable_int_24_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_24_u(self, ctx)) + } fn nullable_int_32_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_32_u(self, ctx)) + } fn nullable_int_40_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_40_u(self, ctx)) + } fn nullable_int_48_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_48_u(self, ctx)) + } fn nullable_int_56_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_56_u(self, ctx)) + } fn nullable_int_64_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_64_u(self, ctx)) + } fn nullable_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_8_s(self, ctx)) + } fn nullable_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_16_s(self, ctx)) + } fn nullable_int_24_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_24_s(self, ctx)) + } fn nullable_int_32_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_32_s(self, ctx)) + } fn nullable_int_40_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_40_s(self, ctx)) + } fn nullable_int_48_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_48_s(self, ctx)) + } fn nullable_int_56_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_56_s(self, ctx)) + } fn nullable_int_64_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_int_64_s(self, ctx)) + } fn nullable_enum_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_enum_8(self, ctx)) + } fn nullable_enum_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_enum_16(self, ctx)) + } fn nullable_float_single( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_float_single( + self, ctx, + )) + } fn nullable_float_double( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready(::nullable_float_double( + self, ctx, + )) + } fn nullable_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -22090,7 +25112,11 @@ pub mod unit_testing { P, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::nullable_octet_string( + self, ctx, builder, + )) + } fn nullable_char_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, @@ -22098,172 +25124,277 @@ pub mod unit_testing { P, rs_matter_crate::tlv::Utf8StrBuilder

, >, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::nullable_char_string( + self, ctx, builder, + )) + } fn nullable_enum_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + core::future::ready(::nullable_enum_attr(self, ctx)) + } fn nullable_struct( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::NullableBuilder>, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::nullable_struct( + self, ctx, builder, + )) + } fn nullable_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready( + ::nullable_range_restricted_int_8_u(self, ctx), + ) + } fn nullable_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready( + ::nullable_range_restricted_int_8_s(self, ctx), + ) + } fn nullable_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready( + ::nullable_range_restricted_int_16_u(self, ctx), + ) + } fn nullable_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error>; + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + core::future::ready( + ::nullable_range_restricted_int_16_s(self, ctx), + ) + } fn write_only_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> { + core::future::ready(::write_only_int_8_u(self, ctx)) } fn mei_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::mei_int_8_u(self, ctx)) + } fn set_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_boolean(self, ctx, value)) + } fn set_bitmap_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap8MaskMap, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_bitmap_8(self, ctx, value)) + } fn set_bitmap_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap16MaskMap, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_bitmap_16( + self, ctx, value, + )) + } fn set_bitmap_32( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap32MaskMap, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_bitmap_32( + self, ctx, value, + )) + } fn set_bitmap_64( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap64MaskMap, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_bitmap_64( + self, ctx, value, + )) + } fn set_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_8_u(self, ctx, value)) + } fn set_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_16_u(self, ctx, value)) + } fn set_int_24_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_24_u(self, ctx, value)) + } fn set_int_32_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_32_u(self, ctx, value)) + } fn set_int_40_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_40_u(self, ctx, value)) + } fn set_int_48_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_48_u(self, ctx, value)) + } fn set_int_56_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_56_u(self, ctx, value)) + } fn set_int_64_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_64_u(self, ctx, value)) + } fn set_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_8_s(self, ctx, value)) + } fn set_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_16_s(self, ctx, value)) + } fn set_int_24_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_24_s(self, ctx, value)) + } fn set_int_32_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_32_s(self, ctx, value)) + } fn set_int_40_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_40_s(self, ctx, value)) + } fn set_int_48_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_48_s(self, ctx, value)) + } fn set_int_56_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_56_s(self, ctx, value)) + } fn set_int_64_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_int_64_s(self, ctx, value)) + } fn set_enum_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_enum_8(self, ctx, value)) + } fn set_enum_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_enum_16(self, ctx, value)) + } fn set_float_single( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: f32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_float_single( + self, ctx, value, + )) + } fn set_float_double( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: f64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_float_double( + self, ctx, value, + )) + } fn set_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::OctetStr<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_octet_string( + self, ctx, value, + )) + } fn set_list_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22271,7 +25402,11 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, u8>, u8, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_list_int_8_u( + self, ctx, value, + )) + } fn set_list_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22279,7 +25414,11 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, rs_matter_crate::tlv::OctetStr<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_list_octet_string( + self, ctx, value, + )) + } fn set_list_struct_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22287,37 +25426,61 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, TestListStructOctet<'_>>, TestListStructOctet<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_list_struct_octet_string( + self, ctx, value, + )) + } fn set_long_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::OctetStr<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_long_octet_string( + self, ctx, value, + )) + } fn set_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Utf8Str<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_char_string( + self, ctx, value, + )) + } fn set_long_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Utf8Str<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_long_char_string( + self, ctx, value, + )) + } fn set_epoch_us( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_epoch_us(self, ctx, value)) + } fn set_epoch_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_epoch_s(self, ctx, value)) + } fn set_vendor_id( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_vendor_id( + self, ctx, value, + )) + } fn set_list_nullables_and_optionals_struct( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22325,37 +25488,67 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, NullablesAndOptionalsStruct<'_>>, NullablesAndOptionalsStruct<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::set_list_nullables_and_optionals_struct( + self, ctx, value, + ), + ) + } fn set_enum_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: SimpleEnum, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_enum_attr( + self, ctx, value, + )) + } fn set_struct_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: SimpleStruct<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_struct_attr( + self, ctx, value, + )) + } fn set_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_range_restricted_int_8_u( + self, ctx, value, + )) + } fn set_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_range_restricted_int_8_s( + self, ctx, value, + )) + } fn set_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_range_restricted_int_16_u( + self, ctx, value, + )) + } fn set_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i16, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_range_restricted_int_16_s( + self, ctx, value, + )) + } fn set_list_long_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22363,7 +25556,11 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, rs_matter_crate::tlv::OctetStr<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_list_long_octet_string( + self, ctx, value, + )) + } fn set_list_fabric_scoped( &self, ctx: impl rs_matter_crate::dm::WriteContext, @@ -22371,265 +25568,483 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, TestFabricScoped<'_>>, TestFabricScoped<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_list_fabric_scoped( + self, ctx, value, + )) + } fn set_timed_write_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_timed_write_boolean( + self, ctx, value, + )) + } fn set_general_error_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_general_error_boolean( + self, ctx, value, + )) + } fn set_cluster_error_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_cluster_error_boolean( + self, ctx, value, + )) + } fn set_unsupported( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> { + core::future::ready(::set_unsupported( + self, ctx, value, + )) } fn set_nullable_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_boolean( + self, ctx, value, + )) + } fn set_nullable_bitmap_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_bitmap_8( + self, ctx, value, + )) + } fn set_nullable_bitmap_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_bitmap_16( + self, ctx, value, + )) + } fn set_nullable_bitmap_32( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_bitmap_32( + self, ctx, value, + )) + } fn set_nullable_bitmap_64( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_bitmap_64( + self, ctx, value, + )) + } fn set_nullable_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_8_u( + self, ctx, value, + )) + } fn set_nullable_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_16_u( + self, ctx, value, + )) + } fn set_nullable_int_24_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_24_u( + self, ctx, value, + )) + } fn set_nullable_int_32_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_32_u( + self, ctx, value, + )) + } fn set_nullable_int_40_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_40_u( + self, ctx, value, + )) + } fn set_nullable_int_48_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_48_u( + self, ctx, value, + )) + } fn set_nullable_int_56_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_56_u( + self, ctx, value, + )) + } fn set_nullable_int_64_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_64_u( + self, ctx, value, + )) + } fn set_nullable_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_8_s( + self, ctx, value, + )) + } fn set_nullable_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_16_s( + self, ctx, value, + )) + } fn set_nullable_int_24_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_24_s( + self, ctx, value, + )) + } fn set_nullable_int_32_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_32_s( + self, ctx, value, + )) + } fn set_nullable_int_40_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_40_s( + self, ctx, value, + )) + } fn set_nullable_int_48_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_48_s( + self, ctx, value, + )) + } fn set_nullable_int_56_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_56_s( + self, ctx, value, + )) + } fn set_nullable_int_64_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_int_64_s( + self, ctx, value, + )) + } fn set_nullable_enum_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_enum_8( + self, ctx, value, + )) + } fn set_nullable_enum_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_enum_16( + self, ctx, value, + )) + } fn set_nullable_float_single( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_float_single( + self, ctx, value, + )) + } fn set_nullable_float_double( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_float_double( + self, ctx, value, + )) + } fn set_nullable_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_octet_string( + self, ctx, value, + )) + } fn set_nullable_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_char_string( + self, ctx, value, + )) + } fn set_nullable_enum_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_enum_attr( + self, ctx, value, + )) + } fn set_nullable_struct( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_nullable_struct( + self, ctx, value, + )) + } fn set_nullable_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::set_nullable_range_restricted_int_8_u( + self, ctx, value, + ), + ) + } fn set_nullable_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::set_nullable_range_restricted_int_8_s( + self, ctx, value, + ), + ) + } fn set_nullable_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::set_nullable_range_restricted_int_16_u( + self, ctx, value, + ), + ) + } fn set_nullable_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::set_nullable_range_restricted_int_16_s( + self, ctx, value, + ), + ) + } fn set_write_only_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> { + core::future::ready(::set_write_only_int_8_u( + self, ctx, value, + )) } fn set_mei_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::set_mei_int_8_u( + self, ctx, value, + )) + } fn handle_test( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::handle_test(self, ctx)) + } fn handle_test_not_handled( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::handle_test_not_handled( + self, ctx, + )) + } fn handle_test_specific( &self, ctx: impl rs_matter_crate::dm::InvokeContext, response: TestSpecificResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::handle_test_specific( + self, ctx, response, + )) + } fn handle_test_unknown_command( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::handle_test_unknown_command( + self, ctx, + )) + } fn handle_test_add_arguments( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestAddArgumentsRequest<'_>, response: TestAddArgumentsResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::handle_test_add_arguments( + self, ctx, request, response, + )) + } fn handle_test_simple_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSimpleArgumentRequestRequest<'_>, response: TestSimpleArgumentResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_simple_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_struct_array_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestStructArrayArgumentRequestRequest<'_>, response: TestStructArrayArgumentResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_struct_array_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_struct_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_nested_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNestedStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_nested_struct_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_list_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_list_struct_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_list_int_8_u_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListInt8UArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_list_int_8_u_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_nested_struct_list_argument_request< P: rs_matter_crate::tlv::TLVBuilderParent, >( @@ -22637,7 +26052,13 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNestedStructListArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_nested_struct_list_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_list_nested_struct_list_argument_request< P: rs_matter_crate::tlv::TLVBuilderParent, >( @@ -22645,25 +26066,47 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListNestedStructListArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_list_nested_struct_list_argument_request( + self, ctx, request, response, + ), + ) + } fn handle_test_list_int_8_u_reverse_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListInt8UReverseRequestRequest<'_>, response: TestListInt8UReverseResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_list_int_8_u_reverse_request( + self, ctx, request, response, + ), + ) + } fn handle_test_enums_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEnumsRequestRequest<'_>, response: TestEnumsResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready(::handle_test_enums_request( + self, ctx, request, response, + )) + } fn handle_test_nullable_optional_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNullableOptionalRequestRequest<'_>, response: TestNullableOptionalResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_nullable_optional_request( + self, ctx, request, response, + ), + ) + } fn handle_test_complex_nullable_optional_request< P: rs_matter_crate::tlv::TLVBuilderParent, >( @@ -22671,28 +26114,56 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestComplexNullableOptionalRequestRequest<'_>, response: TestComplexNullableOptionalResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_complex_nullable_optional_request( + self, ctx, request, response, + ), + ) + } fn handle_simple_struct_echo_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: SimpleStructEchoRequestRequest<'_>, response: SimpleStructResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_simple_struct_echo_request( + self, ctx, request, response, + ), + ) + } fn handle_timed_invoke_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready(::handle_timed_invoke_request( + self, ctx, + )) + } fn handle_test_simple_optional_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSimpleOptionalArgumentRequestRequest<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_simple_optional_argument_request( + self, ctx, request, + ), + ) + } fn handle_test_emit_test_event_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEmitTestEventRequestRequest<'_>, response: TestEmitTestEventResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_emit_test_event_request( + self, ctx, request, response, + ), + ) + } fn handle_test_emit_test_fabric_scoped_event_request< P: rs_matter_crate::tlv::TLVBuilderParent, >( @@ -22700,25 +26171,49 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEmitTestFabricScopedEventRequestRequest<'_>, response: TestEmitTestFabricScopedEventResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_emit_test_fabric_scoped_event_request( + self, ctx, request, response, + ), + ) + } fn handle_test_batch_helper_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestBatchHelperRequestRequest<'_>, response: TestBatchHelperResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_batch_helper_request( + self, ctx, request, response, + ), + ) + } fn handle_test_second_batch_helper_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSecondBatchHelperRequestRequest<'_>, response: TestBatchHelperResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_second_batch_helper_request( + self, ctx, request, response, + ), + ) + } fn handle_test_different_vendor_mei_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestDifferentVendorMeiRequestRequest<'_>, response: TestDifferentVendorMeiResponseBuilder

, - ) -> Result; + ) -> impl core::future::Future> { + core::future::ready( + ::handle_test_different_vendor_mei_request( + self, ctx, request, response, + ), + ) + } } impl ClusterHandler for &T where @@ -22731,162 +26226,190 @@ pub mod unit_testing { fn dataver_changed(&self) { T::dataver_changed(self) } + fn run( + &self, + ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> { + (**self).run(ctx) + } fn boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::boolean(self, ctx) + ) -> impl core::future::Future> + { + ::boolean(self, ctx) } fn bitmap_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::bitmap_8(self, ctx) + ) -> impl core::future::Future> + { + ::bitmap_8(self, ctx) } fn bitmap_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::bitmap_16(self, ctx) + ) -> impl core::future::Future> + { + ::bitmap_16(self, ctx) } fn bitmap_32( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::bitmap_32(self, ctx) + ) -> impl core::future::Future> + { + ::bitmap_32(self, ctx) } fn bitmap_64( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::bitmap_64(self, ctx) + ) -> impl core::future::Future> + { + ::bitmap_64(self, ctx) } fn int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_8_u(self, ctx) + ) -> impl core::future::Future> { + ::int_8_u(self, ctx) } fn int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_16_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_16_u(self, ctx) } fn int_24_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_24_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_24_u(self, ctx) } fn int_32_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_32_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_32_u(self, ctx) } fn int_40_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_40_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_40_u(self, ctx) } fn int_48_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_48_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_48_u(self, ctx) } fn int_56_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_56_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_56_u(self, ctx) } fn int_64_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_64_u(self, ctx) + ) -> impl core::future::Future> + { + ::int_64_u(self, ctx) } fn int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_8_s(self, ctx) + ) -> impl core::future::Future> { + ::int_8_s(self, ctx) } fn int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_16_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_16_s(self, ctx) } fn int_24_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_24_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_24_s(self, ctx) } fn int_32_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_32_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_32_s(self, ctx) } fn int_40_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_40_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_40_s(self, ctx) } fn int_48_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_48_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_48_s(self, ctx) } fn int_56_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_56_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_56_s(self, ctx) } fn int_64_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::int_64_s(self, ctx) + ) -> impl core::future::Future> + { + ::int_64_s(self, ctx) } fn enum_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::enum_8(self, ctx) + ) -> impl core::future::Future> { + ::enum_8(self, ctx) } fn enum_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::enum_16(self, ctx) + ) -> impl core::future::Future> + { + ::enum_16(self, ctx) } fn float_single( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::float_single(self, ctx) + ) -> impl core::future::Future> + { + ::float_single(self, ctx) } fn float_double( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::float_double(self, ctx) + ) -> impl core::future::Future> + { + ::float_double(self, ctx) } fn octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::OctetsBuilder

, - ) -> Result { - T::octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::octet_string(self, ctx, builder) } fn list_int_8_u( &self, @@ -22895,8 +26418,8 @@ pub mod unit_testing { rs_matter_crate::tlv::ToTLVArrayBuilder, rs_matter_crate::tlv::ToTLVBuilder, >, - ) -> Result { - T::list_int_8_u(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_int_8_u(self, ctx, builder) } fn list_octet_string( &self, @@ -22905,8 +26428,8 @@ pub mod unit_testing { rs_matter_crate::tlv::OctetsArrayBuilder

, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result { - T::list_octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_octet_string(self, ctx, builder) } fn list_struct_octet_string( &self, @@ -22915,47 +26438,50 @@ pub mod unit_testing { TestListStructOctetArrayBuilder

, TestListStructOctetBuilder

, >, - ) -> Result { - T::list_struct_octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_struct_octet_string(self, ctx, builder) } fn long_octet_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::OctetsBuilder

, - ) -> Result { - T::long_octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::long_octet_string(self, ctx, builder) } fn char_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::Utf8StrBuilder

, - ) -> Result { - T::char_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::char_string(self, ctx, builder) } fn long_char_string( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::Utf8StrBuilder

, - ) -> Result { - T::long_char_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::long_char_string(self, ctx, builder) } fn epoch_us( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::epoch_us(self, ctx) + ) -> impl core::future::Future> + { + ::epoch_us(self, ctx) } fn epoch_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::epoch_s(self, ctx) + ) -> impl core::future::Future> + { + ::epoch_s(self, ctx) } fn vendor_id( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::vendor_id(self, ctx) + ) -> impl core::future::Future> + { + ::vendor_id(self, ctx) } fn list_nullables_and_optionals_struct( &self, @@ -22964,45 +26490,48 @@ pub mod unit_testing { NullablesAndOptionalsStructArrayBuilder

, NullablesAndOptionalsStructBuilder

, >, - ) -> Result { - T::list_nullables_and_optionals_struct(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_nullables_and_optionals_struct(self, ctx, builder) } fn enum_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::enum_attr(self, ctx) + ) -> impl core::future::Future> + { + ::enum_attr(self, ctx) } fn struct_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: SimpleStructBuilder

, - ) -> Result { - T::struct_attr(self, ctx, builder) + ) -> impl core::future::Future> { + ::struct_attr(self, ctx, builder) } fn range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::range_restricted_int_8_u(self, ctx) + ) -> impl core::future::Future> { + ::range_restricted_int_8_u(self, ctx) } fn range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::range_restricted_int_8_s(self, ctx) + ) -> impl core::future::Future> { + ::range_restricted_int_8_s(self, ctx) } fn range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::range_restricted_int_16_u(self, ctx) + ) -> impl core::future::Future> + { + ::range_restricted_int_16_u(self, ctx) } fn range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::range_restricted_int_16_s(self, ctx) + ) -> impl core::future::Future> + { + ::range_restricted_int_16_s(self, ctx) } fn list_long_octet_string( &self, @@ -23011,8 +26540,8 @@ pub mod unit_testing { rs_matter_crate::tlv::OctetsArrayBuilder

, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result { - T::list_long_octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_long_octet_string(self, ctx, builder) } fn list_fabric_scoped( &self, @@ -23021,186 +26550,248 @@ pub mod unit_testing { TestFabricScopedArrayBuilder

, TestFabricScopedBuilder

, >, - ) -> Result { - T::list_fabric_scoped(self, ctx, builder) + ) -> impl core::future::Future> { + ::list_fabric_scoped(self, ctx, builder) } fn timed_write_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::timed_write_boolean(self, ctx) + ) -> impl core::future::Future> + { + ::timed_write_boolean(self, ctx) } fn general_error_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::general_error_boolean(self, ctx) + ) -> impl core::future::Future> + { + ::general_error_boolean(self, ctx) } fn cluster_error_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::cluster_error_boolean(self, ctx) + ) -> impl core::future::Future> + { + ::cluster_error_boolean(self, ctx) } fn unsupported( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::unsupported(self, ctx) + ) -> impl core::future::Future> + { + ::unsupported(self, ctx) } fn nullable_boolean( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_boolean(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_boolean(self, ctx) } fn nullable_bitmap_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> - { - T::nullable_bitmap_8(self, ctx) + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::nullable_bitmap_8(self, ctx) } fn nullable_bitmap_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> - { - T::nullable_bitmap_16(self, ctx) + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::nullable_bitmap_16(self, ctx) } fn nullable_bitmap_32( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> - { - T::nullable_bitmap_32(self, ctx) + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::nullable_bitmap_32(self, ctx) } fn nullable_bitmap_64( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> - { - T::nullable_bitmap_64(self, ctx) + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::nullable_bitmap_64(self, ctx) } fn nullable_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_8_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_8_u(self, ctx) } fn nullable_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_16_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_16_u(self, ctx) } fn nullable_int_24_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_24_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_24_u(self, ctx) } fn nullable_int_32_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_32_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_32_u(self, ctx) } fn nullable_int_40_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_40_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_40_u(self, ctx) } fn nullable_int_48_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_48_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_48_u(self, ctx) } fn nullable_int_56_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_56_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_56_u(self, ctx) } fn nullable_int_64_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_64_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_64_u(self, ctx) } fn nullable_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_8_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_8_s(self, ctx) } fn nullable_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_16_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_16_s(self, ctx) } fn nullable_int_24_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_24_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_24_s(self, ctx) } fn nullable_int_32_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_32_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_32_s(self, ctx) } fn nullable_int_40_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_40_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_40_s(self, ctx) } fn nullable_int_48_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_48_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_48_s(self, ctx) } fn nullable_int_56_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_56_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_56_s(self, ctx) } fn nullable_int_64_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_int_64_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_int_64_s(self, ctx) } fn nullable_enum_8( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_enum_8(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_enum_8(self, ctx) } fn nullable_enum_16( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_enum_16(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_enum_16(self, ctx) } fn nullable_float_single( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_float_single(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_float_single(self, ctx) } fn nullable_float_double( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_float_double(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_float_double(self, ctx) } fn nullable_octet_string( &self, @@ -23209,8 +26800,8 @@ pub mod unit_testing { P, rs_matter_crate::tlv::OctetsBuilder

, >, - ) -> Result { - T::nullable_octet_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::nullable_octet_string(self, ctx, builder) } fn nullable_char_string( &self, @@ -23219,240 +26810,252 @@ pub mod unit_testing { P, rs_matter_crate::tlv::Utf8StrBuilder

, >, - ) -> Result { - T::nullable_char_string(self, ctx, builder) + ) -> impl core::future::Future> { + ::nullable_char_string(self, ctx, builder) } fn nullable_enum_attr( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> - { - T::nullable_enum_attr(self, ctx) + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::nullable_enum_attr(self, ctx) } fn nullable_struct( &self, ctx: impl rs_matter_crate::dm::ReadContext, builder: rs_matter_crate::tlv::NullableBuilder>, - ) -> Result { - T::nullable_struct(self, ctx, builder) + ) -> impl core::future::Future> { + ::nullable_struct(self, ctx, builder) } fn nullable_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_range_restricted_int_8_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_range_restricted_int_8_u(self, ctx) } fn nullable_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_range_restricted_int_8_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_range_restricted_int_8_s(self, ctx) } fn nullable_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_range_restricted_int_16_u(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_range_restricted_int_16_u(self, ctx) } fn nullable_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result, rs_matter_crate::error::Error> { - T::nullable_range_restricted_int_16_s(self, ctx) + ) -> impl core::future::Future< + Output = Result, rs_matter_crate::error::Error>, + > { + ::nullable_range_restricted_int_16_s(self, ctx) } fn write_only_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::write_only_int_8_u(self, ctx) + ) -> impl core::future::Future> { + ::write_only_int_8_u(self, ctx) } fn mei_int_8_u( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - T::mei_int_8_u(self, ctx) + ) -> impl core::future::Future> { + ::mei_int_8_u(self, ctx) } fn set_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_boolean(self, ctx, value) + ) -> impl core::future::Future> { + ::set_boolean(self, ctx, value) } fn set_bitmap_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap8MaskMap, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_bitmap_8(self, ctx, value) + ) -> impl core::future::Future> { + ::set_bitmap_8(self, ctx, value) } fn set_bitmap_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap16MaskMap, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_bitmap_16(self, ctx, value) + ) -> impl core::future::Future> { + ::set_bitmap_16(self, ctx, value) } fn set_bitmap_32( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap32MaskMap, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_bitmap_32(self, ctx, value) + ) -> impl core::future::Future> { + ::set_bitmap_32(self, ctx, value) } fn set_bitmap_64( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: Bitmap64MaskMap, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_bitmap_64(self, ctx, value) + ) -> impl core::future::Future> { + ::set_bitmap_64(self, ctx, value) } fn set_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_8_u(self, ctx, value) } fn set_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_16_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_16_u(self, ctx, value) } fn set_int_24_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_24_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_24_u(self, ctx, value) } fn set_int_32_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_32_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_32_u(self, ctx, value) } fn set_int_40_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_40_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_40_u(self, ctx, value) } fn set_int_48_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_48_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_48_u(self, ctx, value) } fn set_int_56_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_56_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_56_u(self, ctx, value) } fn set_int_64_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_64_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_64_u(self, ctx, value) } fn set_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_8_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_8_s(self, ctx, value) } fn set_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_16_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_16_s(self, ctx, value) } fn set_int_24_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_24_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_24_s(self, ctx, value) } fn set_int_32_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_32_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_32_s(self, ctx, value) } fn set_int_40_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_40_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_40_s(self, ctx, value) } fn set_int_48_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_48_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_48_s(self, ctx, value) } fn set_int_56_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_56_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_56_s(self, ctx, value) } fn set_int_64_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_int_64_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_int_64_s(self, ctx, value) } fn set_enum_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_enum_8(self, ctx, value) + ) -> impl core::future::Future> { + ::set_enum_8(self, ctx, value) } fn set_enum_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_enum_16(self, ctx, value) + ) -> impl core::future::Future> { + ::set_enum_16(self, ctx, value) } fn set_float_single( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: f32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_float_single(self, ctx, value) + ) -> impl core::future::Future> { + ::set_float_single(self, ctx, value) } fn set_float_double( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: f64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_float_double(self, ctx, value) + ) -> impl core::future::Future> { + ::set_float_double(self, ctx, value) } fn set_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::OctetStr<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_octet_string(self, ctx, value) } fn set_list_int_8_u( &self, @@ -23461,8 +27064,8 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, u8>, u8, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_int_8_u(self, ctx, value) } fn set_list_octet_string( &self, @@ -23471,8 +27074,8 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, rs_matter_crate::tlv::OctetStr<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_octet_string(self, ctx, value) } fn set_list_struct_octet_string( &self, @@ -23481,50 +27084,50 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, TestListStructOctet<'_>>, TestListStructOctet<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_struct_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_struct_octet_string(self, ctx, value) } fn set_long_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::OctetStr<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_long_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_long_octet_string(self, ctx, value) } fn set_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Utf8Str<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_char_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_char_string(self, ctx, value) } fn set_long_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Utf8Str<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_long_char_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_long_char_string(self, ctx, value) } fn set_epoch_us( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u64, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_epoch_us(self, ctx, value) + ) -> impl core::future::Future> { + ::set_epoch_us(self, ctx, value) } fn set_epoch_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u32, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_epoch_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_epoch_s(self, ctx, value) } fn set_vendor_id( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_vendor_id(self, ctx, value) + ) -> impl core::future::Future> { + ::set_vendor_id(self, ctx, value) } fn set_list_nullables_and_optionals_struct( &self, @@ -23533,50 +27136,50 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, NullablesAndOptionalsStruct<'_>>, NullablesAndOptionalsStruct<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_nullables_and_optionals_struct(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_nullables_and_optionals_struct(self, ctx, value) } fn set_enum_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: SimpleEnum, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_enum_attr(self, ctx, value) + ) -> impl core::future::Future> { + ::set_enum_attr(self, ctx, value) } fn set_struct_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: SimpleStruct<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_struct_attr(self, ctx, value) + ) -> impl core::future::Future> { + ::set_struct_attr(self, ctx, value) } fn set_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_range_restricted_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_range_restricted_int_8_u(self, ctx, value) } fn set_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_range_restricted_int_8_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_range_restricted_int_8_s(self, ctx, value) } fn set_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_range_restricted_int_16_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_range_restricted_int_16_u(self, ctx, value) } fn set_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: i16, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_range_restricted_int_16_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_range_restricted_int_16_s(self, ctx, value) } fn set_list_long_octet_string( &self, @@ -23585,8 +27188,8 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, rs_matter_crate::tlv::OctetStr<'_>>, rs_matter_crate::tlv::OctetStr<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_long_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_long_octet_string(self, ctx, value) } fn set_list_fabric_scoped( &self, @@ -23595,362 +27198,370 @@ pub mod unit_testing { rs_matter_crate::tlv::TLVArray<'_, TestFabricScoped<'_>>, TestFabricScoped<'_>, >, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_list_fabric_scoped(self, ctx, value) + ) -> impl core::future::Future> { + ::set_list_fabric_scoped(self, ctx, value) } fn set_timed_write_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_timed_write_boolean(self, ctx, value) + ) -> impl core::future::Future> { + ::set_timed_write_boolean(self, ctx, value) } fn set_general_error_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_general_error_boolean(self, ctx, value) + ) -> impl core::future::Future> { + ::set_general_error_boolean(self, ctx, value) } fn set_cluster_error_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_cluster_error_boolean(self, ctx, value) + ) -> impl core::future::Future> { + ::set_cluster_error_boolean(self, ctx, value) } fn set_unsupported( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: bool, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_unsupported(self, ctx, value) + ) -> impl core::future::Future> { + ::set_unsupported(self, ctx, value) } fn set_nullable_boolean( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_boolean(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_boolean(self, ctx, value) } fn set_nullable_bitmap_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_bitmap_8(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_bitmap_8(self, ctx, value) } fn set_nullable_bitmap_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_bitmap_16(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_bitmap_16(self, ctx, value) } fn set_nullable_bitmap_32( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_bitmap_32(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_bitmap_32(self, ctx, value) } fn set_nullable_bitmap_64( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_bitmap_64(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_bitmap_64(self, ctx, value) } fn set_nullable_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_8_u(self, ctx, value) } fn set_nullable_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_16_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_16_u(self, ctx, value) } fn set_nullable_int_24_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_24_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_24_u(self, ctx, value) } fn set_nullable_int_32_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_32_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_32_u(self, ctx, value) } fn set_nullable_int_40_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_40_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_40_u(self, ctx, value) } fn set_nullable_int_48_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_48_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_48_u(self, ctx, value) } fn set_nullable_int_56_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_56_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_56_u(self, ctx, value) } fn set_nullable_int_64_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_64_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_64_u(self, ctx, value) } fn set_nullable_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_8_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_8_s(self, ctx, value) } fn set_nullable_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_16_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_16_s(self, ctx, value) } fn set_nullable_int_24_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_24_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_24_s(self, ctx, value) } fn set_nullable_int_32_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_32_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_32_s(self, ctx, value) } fn set_nullable_int_40_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_40_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_40_s(self, ctx, value) } fn set_nullable_int_48_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_48_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_48_s(self, ctx, value) } fn set_nullable_int_56_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_56_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_56_s(self, ctx, value) } fn set_nullable_int_64_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_int_64_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_int_64_s(self, ctx, value) } fn set_nullable_enum_8( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_enum_8(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_enum_8(self, ctx, value) } fn set_nullable_enum_16( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_enum_16(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_enum_16(self, ctx, value) } fn set_nullable_float_single( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_float_single(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_float_single(self, ctx, value) } fn set_nullable_float_double( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_float_double(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_float_double(self, ctx, value) } fn set_nullable_octet_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_octet_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_octet_string(self, ctx, value) } fn set_nullable_char_string( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_char_string(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_char_string(self, ctx, value) } fn set_nullable_enum_attr( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_enum_attr(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_enum_attr(self, ctx, value) } fn set_nullable_struct( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_struct(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_struct(self, ctx, value) } fn set_nullable_range_restricted_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_range_restricted_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_range_restricted_int_8_u(self, ctx, value) } fn set_nullable_range_restricted_int_8_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_range_restricted_int_8_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_range_restricted_int_8_s(self, ctx, value) } fn set_nullable_range_restricted_int_16_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_range_restricted_int_16_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_range_restricted_int_16_u(self, ctx, value) } fn set_nullable_range_restricted_int_16_s( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_nullable_range_restricted_int_16_s(self, ctx, value) + ) -> impl core::future::Future> { + ::set_nullable_range_restricted_int_16_s(self, ctx, value) } fn set_write_only_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_write_only_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_write_only_int_8_u(self, ctx, value) } fn set_mei_int_8_u( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u8, - ) -> Result<(), rs_matter_crate::error::Error> { - T::set_mei_int_8_u(self, ctx, value) + ) -> impl core::future::Future> { + ::set_mei_int_8_u(self, ctx, value) } fn handle_test( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_test(self, ctx) + ) -> impl core::future::Future> { + ::handle_test(self, ctx) } fn handle_test_not_handled( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_test_not_handled(self, ctx) + ) -> impl core::future::Future> { + ::handle_test_not_handled(self, ctx) } fn handle_test_specific( &self, ctx: impl rs_matter_crate::dm::InvokeContext, response: TestSpecificResponseBuilder

, - ) -> Result { - T::handle_test_specific(self, ctx, response) + ) -> impl core::future::Future> { + ::handle_test_specific(self, ctx, response) } fn handle_test_unknown_command( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_test_unknown_command(self, ctx) + ) -> impl core::future::Future> { + ::handle_test_unknown_command(self, ctx) } fn handle_test_add_arguments( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestAddArgumentsRequest<'_>, response: TestAddArgumentsResponseBuilder

, - ) -> Result { - T::handle_test_add_arguments(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_add_arguments(self, ctx, request, response) } fn handle_test_simple_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSimpleArgumentRequestRequest<'_>, response: TestSimpleArgumentResponseBuilder

, - ) -> Result { - T::handle_test_simple_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_simple_argument_request(self, ctx, request, response) } fn handle_test_struct_array_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestStructArrayArgumentRequestRequest<'_>, response: TestStructArrayArgumentResponseBuilder

, - ) -> Result { - T::handle_test_struct_array_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_struct_array_argument_request( + self, ctx, request, response, + ) } fn handle_test_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_struct_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_struct_argument_request(self, ctx, request, response) } fn handle_test_nested_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNestedStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_nested_struct_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_nested_struct_argument_request( + self, ctx, request, response, + ) } fn handle_test_list_struct_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListStructArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_list_struct_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_list_struct_argument_request( + self, ctx, request, response, + ) } fn handle_test_list_int_8_u_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListInt8UArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_list_int_8_u_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_list_int_8_u_argument_request( + self, ctx, request, response, + ) } fn handle_test_nested_struct_list_argument_request< P: rs_matter_crate::tlv::TLVBuilderParent, @@ -23959,8 +27570,10 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNestedStructListArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_nested_struct_list_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_nested_struct_list_argument_request( + self, ctx, request, response, + ) } fn handle_test_list_nested_struct_list_argument_request< P: rs_matter_crate::tlv::TLVBuilderParent, @@ -23969,32 +27582,38 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListNestedStructListArgumentRequestRequest<'_>, response: BooleanResponseBuilder

, - ) -> Result { - T::handle_test_list_nested_struct_list_argument_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_list_nested_struct_list_argument_request( + self, ctx, request, response, + ) } fn handle_test_list_int_8_u_reverse_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestListInt8UReverseRequestRequest<'_>, response: TestListInt8UReverseResponseBuilder

, - ) -> Result { - T::handle_test_list_int_8_u_reverse_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_list_int_8_u_reverse_request( + self, ctx, request, response, + ) } fn handle_test_enums_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEnumsRequestRequest<'_>, response: TestEnumsResponseBuilder

, - ) -> Result { - T::handle_test_enums_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_enums_request(self, ctx, request, response) } fn handle_test_nullable_optional_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestNullableOptionalRequestRequest<'_>, response: TestNullableOptionalResponseBuilder

, - ) -> Result { - T::handle_test_nullable_optional_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_nullable_optional_request( + self, ctx, request, response, + ) } fn handle_test_complex_nullable_optional_request< P: rs_matter_crate::tlv::TLVBuilderParent, @@ -24003,37 +27622,39 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestComplexNullableOptionalRequestRequest<'_>, response: TestComplexNullableOptionalResponseBuilder

, - ) -> Result { - T::handle_test_complex_nullable_optional_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_complex_nullable_optional_request( + self, ctx, request, response, + ) } fn handle_simple_struct_echo_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: SimpleStructEchoRequestRequest<'_>, response: SimpleStructResponseBuilder

, - ) -> Result { - T::handle_simple_struct_echo_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_simple_struct_echo_request(self, ctx, request, response) } fn handle_timed_invoke_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_timed_invoke_request(self, ctx) + ) -> impl core::future::Future> { + ::handle_timed_invoke_request(self, ctx) } fn handle_test_simple_optional_argument_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSimpleOptionalArgumentRequestRequest<'_>, - ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_test_simple_optional_argument_request(self, ctx, request) + ) -> impl core::future::Future> { + ::handle_test_simple_optional_argument_request(self, ctx, request) } fn handle_test_emit_test_event_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEmitTestEventRequestRequest<'_>, response: TestEmitTestEventResponseBuilder

, - ) -> Result { - T::handle_test_emit_test_event_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_emit_test_event_request(self, ctx, request, response) } fn handle_test_emit_test_fabric_scoped_event_request< P: rs_matter_crate::tlv::TLVBuilderParent, @@ -24042,44 +27663,51 @@ pub mod unit_testing { ctx: impl rs_matter_crate::dm::InvokeContext, request: TestEmitTestFabricScopedEventRequestRequest<'_>, response: TestEmitTestFabricScopedEventResponseBuilder

, - ) -> Result { - T::handle_test_emit_test_fabric_scoped_event_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_emit_test_fabric_scoped_event_request( + self, ctx, request, response, + ) } fn handle_test_batch_helper_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestBatchHelperRequestRequest<'_>, response: TestBatchHelperResponseBuilder

, - ) -> Result { - T::handle_test_batch_helper_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_batch_helper_request(self, ctx, request, response) } fn handle_test_second_batch_helper_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestSecondBatchHelperRequestRequest<'_>, response: TestBatchHelperResponseBuilder

, - ) -> Result { - T::handle_test_second_batch_helper_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_second_batch_helper_request( + self, ctx, request, response, + ) } fn handle_test_different_vendor_mei_request( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: TestDifferentVendorMeiRequestRequest<'_>, response: TestDifferentVendorMeiResponseBuilder

, - ) -> Result { - T::handle_test_different_vendor_mei_request(self, ctx, request, response) + ) -> impl core::future::Future> { + ::handle_test_different_vendor_mei_request( + self, ctx, request, response, + ) } } + impl ClusterSyncHandler for &T where T: ClusterSyncHandler {} #[doc = "The handler adaptor for the cluster-specific handler. This adaptor implements the generic `rs-matter` handler trait."] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] pub struct HandlerAdaptor(pub T); - impl rs_matter_crate::dm::Handler for HandlerAdaptor + impl rs_matter_crate::dm::AsyncHandler for HandlerAdaptor where T: ClusterHandler, { #[allow(unreachable_code)] - fn read( + async fn read( &self, ctx: impl rs_matter_crate::dm::ReadContext, reply: impl rs_matter_crate::dm::ReadReply, @@ -24090,7 +27718,8 @@ pub mod unit_testing { } else { match AttributeId::try_from(ctx.attr().attr_id)? { AttributeId::Boolean => { - let attr_read_result = self.0.boolean(&ctx); + let attr_read_result = + ::boolean(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24114,7 +27743,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Bitmap8 => { - let attr_read_result = self.0.bitmap_8(&ctx); + let attr_read_result = + ::bitmap_8(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24138,7 +27768,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Bitmap16 => { - let attr_read_result = self.0.bitmap_16(&ctx); + let attr_read_result = + ::bitmap_16(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24162,7 +27793,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Bitmap32 => { - let attr_read_result = self.0.bitmap_32(&ctx); + let attr_read_result = + ::bitmap_32(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24186,7 +27818,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Bitmap64 => { - let attr_read_result = self.0.bitmap_64(&ctx); + let attr_read_result = + ::bitmap_64(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24210,7 +27843,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int8u => { - let attr_read_result = self.0.int_8_u(&ctx); + let attr_read_result = + ::int_8_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24234,7 +27868,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int16u => { - let attr_read_result = self.0.int_16_u(&ctx); + let attr_read_result = + ::int_16_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24258,7 +27893,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int24u => { - let attr_read_result = self.0.int_24_u(&ctx); + let attr_read_result = + ::int_24_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24282,7 +27918,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int32u => { - let attr_read_result = self.0.int_32_u(&ctx); + let attr_read_result = + ::int_32_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24306,7 +27943,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int40u => { - let attr_read_result = self.0.int_40_u(&ctx); + let attr_read_result = + ::int_40_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24330,7 +27968,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int48u => { - let attr_read_result = self.0.int_48_u(&ctx); + let attr_read_result = + ::int_48_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24354,7 +27993,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int56u => { - let attr_read_result = self.0.int_56_u(&ctx); + let attr_read_result = + ::int_56_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24378,7 +28018,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int64u => { - let attr_read_result = self.0.int_64_u(&ctx); + let attr_read_result = + ::int_64_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24402,7 +28043,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int8s => { - let attr_read_result = self.0.int_8_s(&ctx); + let attr_read_result = + ::int_8_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24426,7 +28068,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int16s => { - let attr_read_result = self.0.int_16_s(&ctx); + let attr_read_result = + ::int_16_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24450,7 +28093,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int24s => { - let attr_read_result = self.0.int_24_s(&ctx); + let attr_read_result = + ::int_24_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24474,7 +28118,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int32s => { - let attr_read_result = self.0.int_32_s(&ctx); + let attr_read_result = + ::int_32_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24498,7 +28143,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int40s => { - let attr_read_result = self.0.int_40_s(&ctx); + let attr_read_result = + ::int_40_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24522,7 +28168,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int48s => { - let attr_read_result = self.0.int_48_s(&ctx); + let attr_read_result = + ::int_48_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24546,7 +28193,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int56s => { - let attr_read_result = self.0.int_56_s(&ctx); + let attr_read_result = + ::int_56_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24570,7 +28218,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Int64s => { - let attr_read_result = self.0.int_64_s(&ctx); + let attr_read_result = + ::int_64_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24594,7 +28243,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Enum8 => { - let attr_read_result = self.0.enum_8(&ctx); + let attr_read_result = + ::enum_8(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24618,7 +28268,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Enum16 => { - let attr_read_result = self.0.enum_16(&ctx); + let attr_read_result = + ::enum_16(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24642,7 +28293,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::FloatSingle => { - let attr_read_result = self.0.float_single(&ctx); + let attr_read_result = + ::float_single(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24666,7 +28318,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::FloatDouble => { - let attr_read_result = self.0.float_double(&ctx); + let attr_read_result = + ::float_double(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24710,7 +28363,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.octet_string( + let attr_read_result = ::octet_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -24723,7 +28377,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24768,7 +28423,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_int_8_u( + let attr_read_result = ::list_int_8_u( + &self.0, &ctx, rs_matter_crate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), @@ -24782,7 +28438,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24827,7 +28484,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_octet_string( + let attr_read_result = ::list_octet_string( + &self.0, &ctx, rs_matter_crate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), @@ -24841,7 +28499,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24886,7 +28545,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_struct_octet_string( + let attr_read_result = ::list_struct_octet_string( + &self.0, &ctx, rs_matter_crate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), @@ -24903,7 +28563,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -24948,7 +28609,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.long_octet_string( + let attr_read_result = ::long_octet_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -24961,7 +28623,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25006,7 +28669,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.char_string( + let attr_read_result = ::char_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -25019,7 +28683,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25064,7 +28729,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.long_char_string( + let attr_read_result = ::long_char_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -25077,7 +28743,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25102,7 +28769,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::EpochUs => { - let attr_read_result = self.0.epoch_us(&ctx); + let attr_read_result = + ::epoch_us(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25126,7 +28794,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::EpochS => { - let attr_read_result = self.0.epoch_s(&ctx); + let attr_read_result = + ::epoch_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25150,7 +28819,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::VendorId => { - let attr_read_result = self.0.vendor_id(&ctx); + let attr_read_result = + ::vendor_id(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25200,24 +28870,27 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_nullables_and_optionals_struct( - &ctx, - rs_matter_crate::dm::ArrayAttributeRead::new( - ctx.attr().list_index.clone(), - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.attr().endpoint_id, - self, + let attr_read_result = + ::list_nullables_and_optionals_struct( + &self.0, + &ctx, + rs_matter_crate::dm::ArrayAttributeRead::new( + ctx.attr().list_index.clone(), + rs_matter_crate::tlv::TLVWriteParent::new( MetadataDebug(( - AttributeId::ListNullablesAndOptionalsStruct, - false, + ctx.attr().endpoint_id, + self, + MetadataDebug(( + AttributeId::ListNullablesAndOptionalsStruct, + false, + )), )), - )), - tw, - ), - tag, - )?, - ); + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25248,7 +28921,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::EnumAttr => { - let attr_read_result = self.0.enum_attr(&ctx); + let attr_read_result = + ::enum_attr(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25292,7 +28966,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.struct_attr( + let attr_read_result = ::struct_attr( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -25305,7 +28980,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25330,7 +29006,9 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::RangeRestrictedInt8u => { - let attr_read_result = self.0.range_restricted_int_8_u(&ctx); + let attr_read_result = + ::range_restricted_int_8_u(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25354,7 +29032,9 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::RangeRestrictedInt8s => { - let attr_read_result = self.0.range_restricted_int_8_s(&ctx); + let attr_read_result = + ::range_restricted_int_8_s(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25378,7 +29058,9 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::RangeRestrictedInt16u => { - let attr_read_result = self.0.range_restricted_int_16_u(&ctx); + let attr_read_result = + ::range_restricted_int_16_u(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25402,7 +29084,9 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::RangeRestrictedInt16s => { - let attr_read_result = self.0.range_restricted_int_16_s(&ctx); + let attr_read_result = + ::range_restricted_int_16_s(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25446,7 +29130,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_long_octet_string( + let attr_read_result = ::list_long_octet_string( + &self.0, &ctx, rs_matter_crate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), @@ -25463,7 +29148,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25508,7 +29194,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.list_fabric_scoped( + let attr_read_result = ::list_fabric_scoped( + &self.0, &ctx, rs_matter_crate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), @@ -25522,7 +29209,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25547,7 +29235,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::TimedWriteBoolean => { - let attr_read_result = self.0.timed_write_boolean(&ctx); + let attr_read_result = + ::timed_write_boolean(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25571,7 +29260,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::GeneralErrorBoolean => { - let attr_read_result = self.0.general_error_boolean(&ctx); + let attr_read_result = + ::general_error_boolean(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25595,7 +29285,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::ClusterErrorBoolean => { - let attr_read_result = self.0.cluster_error_boolean(&ctx); + let attr_read_result = + ::cluster_error_boolean(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25619,7 +29310,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::Unsupported => { - let attr_read_result = self.0.unsupported(&ctx); + let attr_read_result = + ::unsupported(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25643,7 +29335,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableBoolean => { - let attr_read_result = self.0.nullable_boolean(&ctx); + let attr_read_result = + ::nullable_boolean(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25667,7 +29360,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableBitmap8 => { - let attr_read_result = self.0.nullable_bitmap_8(&ctx); + let attr_read_result = + ::nullable_bitmap_8(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25691,7 +29385,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableBitmap16 => { - let attr_read_result = self.0.nullable_bitmap_16(&ctx); + let attr_read_result = + ::nullable_bitmap_16(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25715,7 +29410,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableBitmap32 => { - let attr_read_result = self.0.nullable_bitmap_32(&ctx); + let attr_read_result = + ::nullable_bitmap_32(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25739,7 +29435,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableBitmap64 => { - let attr_read_result = self.0.nullable_bitmap_64(&ctx); + let attr_read_result = + ::nullable_bitmap_64(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25763,7 +29460,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt8u => { - let attr_read_result = self.0.nullable_int_8_u(&ctx); + let attr_read_result = + ::nullable_int_8_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25787,7 +29485,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt16u => { - let attr_read_result = self.0.nullable_int_16_u(&ctx); + let attr_read_result = + ::nullable_int_16_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25811,7 +29510,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt24u => { - let attr_read_result = self.0.nullable_int_24_u(&ctx); + let attr_read_result = + ::nullable_int_24_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25835,7 +29535,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt32u => { - let attr_read_result = self.0.nullable_int_32_u(&ctx); + let attr_read_result = + ::nullable_int_32_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25859,7 +29560,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt40u => { - let attr_read_result = self.0.nullable_int_40_u(&ctx); + let attr_read_result = + ::nullable_int_40_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25883,7 +29585,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt48u => { - let attr_read_result = self.0.nullable_int_48_u(&ctx); + let attr_read_result = + ::nullable_int_48_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25907,7 +29610,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt56u => { - let attr_read_result = self.0.nullable_int_56_u(&ctx); + let attr_read_result = + ::nullable_int_56_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25931,7 +29635,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt64u => { - let attr_read_result = self.0.nullable_int_64_u(&ctx); + let attr_read_result = + ::nullable_int_64_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25955,7 +29660,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt8s => { - let attr_read_result = self.0.nullable_int_8_s(&ctx); + let attr_read_result = + ::nullable_int_8_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -25979,7 +29685,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt16s => { - let attr_read_result = self.0.nullable_int_16_s(&ctx); + let attr_read_result = + ::nullable_int_16_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26003,7 +29710,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt24s => { - let attr_read_result = self.0.nullable_int_24_s(&ctx); + let attr_read_result = + ::nullable_int_24_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26027,7 +29735,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt32s => { - let attr_read_result = self.0.nullable_int_32_s(&ctx); + let attr_read_result = + ::nullable_int_32_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26051,7 +29760,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt40s => { - let attr_read_result = self.0.nullable_int_40_s(&ctx); + let attr_read_result = + ::nullable_int_40_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26075,7 +29785,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt48s => { - let attr_read_result = self.0.nullable_int_48_s(&ctx); + let attr_read_result = + ::nullable_int_48_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26099,7 +29810,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt56s => { - let attr_read_result = self.0.nullable_int_56_s(&ctx); + let attr_read_result = + ::nullable_int_56_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26123,7 +29835,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableInt64s => { - let attr_read_result = self.0.nullable_int_64_s(&ctx); + let attr_read_result = + ::nullable_int_64_s(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26147,7 +29860,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableEnum8 => { - let attr_read_result = self.0.nullable_enum_8(&ctx); + let attr_read_result = + ::nullable_enum_8(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26171,7 +29885,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableEnum16 => { - let attr_read_result = self.0.nullable_enum_16(&ctx); + let attr_read_result = + ::nullable_enum_16(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26195,7 +29910,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableFloatSingle => { - let attr_read_result = self.0.nullable_float_single(&ctx); + let attr_read_result = + ::nullable_float_single(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26219,7 +29935,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableFloatDouble => { - let attr_read_result = self.0.nullable_float_double(&ctx); + let attr_read_result = + ::nullable_float_double(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26263,7 +29980,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.nullable_octet_string( + let attr_read_result = ::nullable_octet_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -26279,7 +29997,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26324,7 +30043,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.nullable_char_string( + let attr_read_result = ::nullable_char_string( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -26337,7 +30057,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26362,7 +30083,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::NullableEnumAttr => { - let attr_read_result = self.0.nullable_enum_attr(&ctx); + let attr_read_result = + ::nullable_enum_attr(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26406,7 +30128,8 @@ pub mod unit_testing { ); let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.nullable_struct( + let attr_read_result = ::nullable_struct( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -26419,7 +30142,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26444,7 +30168,11 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer) } AttributeId::NullableRangeRestrictedInt8u => { - let attr_read_result = self.0.nullable_range_restricted_int_8_u(&ctx); + let attr_read_result = + ::nullable_range_restricted_int_8_u( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26474,7 +30202,11 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableRangeRestrictedInt8s => { - let attr_read_result = self.0.nullable_range_restricted_int_8_s(&ctx); + let attr_read_result = + ::nullable_range_restricted_int_8_s( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26504,7 +30236,11 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableRangeRestrictedInt16u => { - let attr_read_result = self.0.nullable_range_restricted_int_16_u(&ctx); + let attr_read_result = + ::nullable_range_restricted_int_16_u( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26534,7 +30270,11 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::NullableRangeRestrictedInt16s => { - let attr_read_result = self.0.nullable_range_restricted_int_16_s(&ctx); + let attr_read_result = + ::nullable_range_restricted_int_16_s( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26564,7 +30304,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::WriteOnlyInt8u => { - let attr_read_result = self.0.write_only_int_8_u(&ctx); + let attr_read_result = + ::write_only_int_8_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26588,7 +30329,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::MeiInt8u => { - let attr_read_result = self.0.mei_int_8_u(&ctx); + let attr_read_result = + ::mei_int_8_u(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -26632,7 +30374,7 @@ pub mod unit_testing { } } #[allow(unreachable_code)] - fn write( + async fn write( &self, ctx: impl rs_matter_crate::dm::WriteContext, ) -> Result<(), rs_matter_crate::error::Error> { @@ -26643,7 +30385,8 @@ pub mod unit_testing { match AttributeId::try_from(ctx.attr().attr_id)? { AttributeId::Boolean => { let attr_data: bool = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_boolean(&ctx, attr_data.clone()); + let attr_write_result = + ::set_boolean(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26671,7 +30414,8 @@ pub mod unit_testing { AttributeId::Bitmap8 => { let attr_data: Bitmap8MaskMap = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_bitmap_8(&ctx, attr_data.clone()); + let attr_write_result = + ::set_bitmap_8(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26699,7 +30443,9 @@ pub mod unit_testing { AttributeId::Bitmap16 => { let attr_data: Bitmap16MaskMap = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_bitmap_16(&ctx, attr_data.clone()); + let attr_write_result = + ::set_bitmap_16(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26727,7 +30473,9 @@ pub mod unit_testing { AttributeId::Bitmap32 => { let attr_data: Bitmap32MaskMap = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_bitmap_32(&ctx, attr_data.clone()); + let attr_write_result = + ::set_bitmap_32(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26755,7 +30503,9 @@ pub mod unit_testing { AttributeId::Bitmap64 => { let attr_data: Bitmap64MaskMap = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_bitmap_64(&ctx, attr_data.clone()); + let attr_write_result = + ::set_bitmap_64(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26782,7 +30532,8 @@ pub mod unit_testing { } AttributeId::Int8u => { let attr_data: u8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_8_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26809,7 +30560,8 @@ pub mod unit_testing { } AttributeId::Int16u => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_16_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_16_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26836,7 +30588,8 @@ pub mod unit_testing { } AttributeId::Int24u => { let attr_data: u32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_24_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_24_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26863,7 +30616,8 @@ pub mod unit_testing { } AttributeId::Int32u => { let attr_data: u32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_32_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_32_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26890,7 +30644,8 @@ pub mod unit_testing { } AttributeId::Int40u => { let attr_data: u64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_40_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_40_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26917,7 +30672,8 @@ pub mod unit_testing { } AttributeId::Int48u => { let attr_data: u64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_48_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_48_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26944,7 +30700,8 @@ pub mod unit_testing { } AttributeId::Int56u => { let attr_data: u64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_56_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_56_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26971,7 +30728,8 @@ pub mod unit_testing { } AttributeId::Int64u => { let attr_data: u64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_64_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_64_u(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -26998,7 +30756,8 @@ pub mod unit_testing { } AttributeId::Int8s => { let attr_data: i8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_8_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_8_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27025,7 +30784,8 @@ pub mod unit_testing { } AttributeId::Int16s => { let attr_data: i16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_16_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_16_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27052,7 +30812,8 @@ pub mod unit_testing { } AttributeId::Int24s => { let attr_data: i32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_24_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_24_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27079,7 +30840,8 @@ pub mod unit_testing { } AttributeId::Int32s => { let attr_data: i32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_32_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_32_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27106,7 +30868,8 @@ pub mod unit_testing { } AttributeId::Int40s => { let attr_data: i64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_40_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_40_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27133,7 +30896,8 @@ pub mod unit_testing { } AttributeId::Int48s => { let attr_data: i64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_48_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_48_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27160,7 +30924,8 @@ pub mod unit_testing { } AttributeId::Int56s => { let attr_data: i64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_56_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_56_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27187,7 +30952,8 @@ pub mod unit_testing { } AttributeId::Int64s => { let attr_data: i64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_int_64_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_int_64_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27214,7 +30980,8 @@ pub mod unit_testing { } AttributeId::Enum8 => { let attr_data: u8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_enum_8(&ctx, attr_data.clone()); + let attr_write_result = + ::set_enum_8(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27241,7 +31008,8 @@ pub mod unit_testing { } AttributeId::Enum16 => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_enum_16(&ctx, attr_data.clone()); + let attr_write_result = + ::set_enum_16(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27268,7 +31036,9 @@ pub mod unit_testing { } AttributeId::FloatSingle => { let attr_data: f32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_float_single(&ctx, attr_data.clone()); + let attr_write_result = + ::set_float_single(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27295,7 +31065,9 @@ pub mod unit_testing { } AttributeId::FloatDouble => { let attr_data: f64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_float_double(&ctx, attr_data.clone()); + let attr_write_result = + ::set_float_double(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27323,7 +31095,9 @@ pub mod unit_testing { AttributeId::OctetString => { let attr_data: rs_matter_crate::tlv::OctetStr<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_octet_string(&ctx, attr_data.clone()); + let attr_write_result = + ::set_octet_string(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27353,7 +31127,9 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = self.0.set_list_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_list_int_8_u(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27383,7 +31159,12 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = self.0.set_list_octet_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_list_octet_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27413,8 +31194,12 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = - self.0.set_list_struct_octet_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_list_struct_octet_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27442,7 +31227,12 @@ pub mod unit_testing { AttributeId::LongOctetString => { let attr_data: rs_matter_crate::tlv::OctetStr<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_long_octet_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_long_octet_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27470,7 +31260,9 @@ pub mod unit_testing { AttributeId::CharString => { let attr_data: rs_matter_crate::tlv::Utf8Str<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_char_string(&ctx, attr_data.clone()); + let attr_write_result = + ::set_char_string(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27498,7 +31290,12 @@ pub mod unit_testing { AttributeId::LongCharString => { let attr_data: rs_matter_crate::tlv::Utf8Str<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_long_char_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_long_char_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27525,7 +31322,8 @@ pub mod unit_testing { } AttributeId::EpochUs => { let attr_data: u64 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_epoch_us(&ctx, attr_data.clone()); + let attr_write_result = + ::set_epoch_us(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27552,7 +31350,8 @@ pub mod unit_testing { } AttributeId::EpochS => { let attr_data: u32 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_epoch_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_epoch_s(&self.0, &ctx, attr_data.clone()).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27579,7 +31378,9 @@ pub mod unit_testing { } AttributeId::VendorId => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_vendor_id(&ctx, attr_data.clone()); + let attr_write_result = + ::set_vendor_id(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27609,9 +31410,13 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = self - .0 - .set_list_nullables_and_optionals_struct(&ctx, attr_data.clone()); + let attr_write_result = + ::set_list_nullables_and_optionals_struct( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27639,7 +31444,9 @@ pub mod unit_testing { AttributeId::EnumAttr => { let attr_data: SimpleEnum = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_enum_attr(&ctx, attr_data.clone()); + let attr_write_result = + ::set_enum_attr(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27667,7 +31474,9 @@ pub mod unit_testing { AttributeId::StructAttr => { let attr_data: SimpleStruct<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_struct_attr(&ctx, attr_data.clone()); + let attr_write_result = + ::set_struct_attr(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27694,8 +31503,12 @@ pub mod unit_testing { } AttributeId::RangeRestrictedInt8u => { let attr_data: u8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_range_restricted_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_range_restricted_int_8_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27722,8 +31535,12 @@ pub mod unit_testing { } AttributeId::RangeRestrictedInt8s => { let attr_data: i8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_range_restricted_int_8_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_range_restricted_int_8_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27750,9 +31567,12 @@ pub mod unit_testing { } AttributeId::RangeRestrictedInt16u => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_range_restricted_int_16_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_range_restricted_int_16_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27779,9 +31599,12 @@ pub mod unit_testing { } AttributeId::RangeRestrictedInt16s => { let attr_data: i16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_range_restricted_int_16_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_range_restricted_int_16_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27811,8 +31634,12 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = - self.0.set_list_long_octet_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_list_long_octet_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27842,7 +31669,12 @@ pub mod unit_testing { ctx.attr().list_index.clone(), ctx.data(), )?; - let attr_write_result = self.0.set_list_fabric_scoped(&ctx, attr_data.clone()); + let attr_write_result = ::set_list_fabric_scoped( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27869,7 +31701,12 @@ pub mod unit_testing { } AttributeId::TimedWriteBoolean => { let attr_data: bool = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_timed_write_boolean(&ctx, attr_data.clone()); + let attr_write_result = ::set_timed_write_boolean( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27896,8 +31733,12 @@ pub mod unit_testing { } AttributeId::GeneralErrorBoolean => { let attr_data: bool = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_general_error_boolean(&ctx, attr_data.clone()); + let attr_write_result = ::set_general_error_boolean( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27924,8 +31765,12 @@ pub mod unit_testing { } AttributeId::ClusterErrorBoolean => { let attr_data: bool = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_cluster_error_boolean(&ctx, attr_data.clone()); + let attr_write_result = ::set_cluster_error_boolean( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27952,7 +31797,9 @@ pub mod unit_testing { } AttributeId::Unsupported => { let attr_data: bool = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_unsupported(&ctx, attr_data.clone()); + let attr_write_result = + ::set_unsupported(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -27980,7 +31827,12 @@ pub mod unit_testing { AttributeId::NullableBoolean => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_boolean(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_boolean( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28008,7 +31860,12 @@ pub mod unit_testing { AttributeId::NullableBitmap8 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_bitmap_8(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_bitmap_8( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28036,7 +31893,12 @@ pub mod unit_testing { AttributeId::NullableBitmap16 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_bitmap_16(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_bitmap_16( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28064,7 +31926,12 @@ pub mod unit_testing { AttributeId::NullableBitmap32 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_bitmap_32(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_bitmap_32( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28092,7 +31959,12 @@ pub mod unit_testing { AttributeId::NullableBitmap64 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_bitmap_64(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_bitmap_64( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28120,7 +31992,12 @@ pub mod unit_testing { AttributeId::NullableInt8u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_8_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28148,7 +32025,12 @@ pub mod unit_testing { AttributeId::NullableInt16u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_16_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_16_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28176,7 +32058,12 @@ pub mod unit_testing { AttributeId::NullableInt24u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_24_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_24_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28204,7 +32091,12 @@ pub mod unit_testing { AttributeId::NullableInt32u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_32_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_32_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28232,7 +32124,12 @@ pub mod unit_testing { AttributeId::NullableInt40u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_40_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_40_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28260,7 +32157,12 @@ pub mod unit_testing { AttributeId::NullableInt48u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_48_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_48_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28288,7 +32190,12 @@ pub mod unit_testing { AttributeId::NullableInt56u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_56_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_56_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28316,7 +32223,12 @@ pub mod unit_testing { AttributeId::NullableInt64u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_64_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_64_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28344,7 +32256,12 @@ pub mod unit_testing { AttributeId::NullableInt8s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_8_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_8_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28372,7 +32289,12 @@ pub mod unit_testing { AttributeId::NullableInt16s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_16_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_16_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28400,7 +32322,12 @@ pub mod unit_testing { AttributeId::NullableInt24s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_24_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_24_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28428,7 +32355,12 @@ pub mod unit_testing { AttributeId::NullableInt32s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_32_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_32_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28456,7 +32388,12 @@ pub mod unit_testing { AttributeId::NullableInt40s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_40_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_40_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28484,7 +32421,12 @@ pub mod unit_testing { AttributeId::NullableInt48s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_48_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_48_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28512,7 +32454,12 @@ pub mod unit_testing { AttributeId::NullableInt56s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_56_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_56_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28540,7 +32487,12 @@ pub mod unit_testing { AttributeId::NullableInt64s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_int_64_s(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_int_64_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28568,7 +32520,12 @@ pub mod unit_testing { AttributeId::NullableEnum8 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_enum_8(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_enum_8( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28596,7 +32553,12 @@ pub mod unit_testing { AttributeId::NullableEnum16 => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_enum_16(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_enum_16( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28624,8 +32586,12 @@ pub mod unit_testing { AttributeId::NullableFloatSingle => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_nullable_float_single(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_float_single( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28653,8 +32619,12 @@ pub mod unit_testing { AttributeId::NullableFloatDouble => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_nullable_float_double(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_float_double( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28683,8 +32653,12 @@ pub mod unit_testing { let attr_data: rs_matter_crate::tlv::Nullable< rs_matter_crate::tlv::OctetStr<'_>, > = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_nullable_octet_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_octet_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28713,8 +32687,12 @@ pub mod unit_testing { let attr_data: rs_matter_crate::tlv::Nullable< rs_matter_crate::tlv::Utf8Str<'_>, > = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_nullable_char_string(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_char_string( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28742,7 +32720,12 @@ pub mod unit_testing { AttributeId::NullableEnumAttr => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_enum_attr(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_enum_attr( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28770,7 +32753,12 @@ pub mod unit_testing { AttributeId::NullableStruct => { let attr_data: rs_matter_crate::tlv::Nullable> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_nullable_struct(&ctx, attr_data.clone()); + let attr_write_result = ::set_nullable_struct( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28798,9 +32786,13 @@ pub mod unit_testing { AttributeId::NullableRangeRestrictedInt8u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_nullable_range_restricted_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_nullable_range_restricted_int_8_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28828,9 +32820,13 @@ pub mod unit_testing { AttributeId::NullableRangeRestrictedInt8s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_nullable_range_restricted_int_8_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_nullable_range_restricted_int_8_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28858,9 +32854,13 @@ pub mod unit_testing { AttributeId::NullableRangeRestrictedInt16u => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_nullable_range_restricted_int_16_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_nullable_range_restricted_int_16_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28888,9 +32888,13 @@ pub mod unit_testing { AttributeId::NullableRangeRestrictedInt16s => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self - .0 - .set_nullable_range_restricted_int_16_s(&ctx, attr_data.clone()); + let attr_write_result = + ::set_nullable_range_restricted_int_16_s( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28917,7 +32921,12 @@ pub mod unit_testing { } AttributeId::WriteOnlyInt8u => { let attr_data: u8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_write_only_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = ::set_write_only_int_8_u( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28944,7 +32953,9 @@ pub mod unit_testing { } AttributeId::MeiInt8u => { let attr_data: u8 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_mei_int_8_u(&ctx, attr_data.clone()); + let attr_write_result = + ::set_mei_int_8_u(&self.0, &ctx, attr_data.clone()) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -28981,14 +32992,14 @@ pub mod unit_testing { Ok(()) } #[allow(unreachable_code)] - fn invoke( + async fn invoke( &self, ctx: impl rs_matter_crate::dm::InvokeContext, reply: impl rs_matter_crate::dm::InvokeReply, ) -> Result<(), rs_matter_crate::error::Error> { match CommandId::try_from(ctx.cmd().cmd_id)? { CommandId::Test => { - let cmd_invoke_result = self.0.handle_test(&ctx); + let cmd_invoke_result = ::handle_test(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -29012,7 +33023,8 @@ pub mod unit_testing { cmd_invoke_result?; } CommandId::TestNotHandled => { - let cmd_invoke_result = self.0.handle_test_not_handled(&ctx); + let cmd_invoke_result = + ::handle_test_not_handled(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -29057,7 +33069,8 @@ pub mod unit_testing { let mut writer = reply.with_command(0u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_specific( + let cmd_invoke_result = ::handle_test_specific( + &self.0, &ctx, rs_matter_crate::tlv::TLVBuilder::new( rs_matter_crate::tlv::TLVWriteParent::new( @@ -29070,7 +33083,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29095,7 +33109,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer)? } CommandId::TestUnknownCommand => { - let cmd_invoke_result = self.0.handle_test_unknown_command(&ctx); + let cmd_invoke_result = + ::handle_test_unknown_command(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -29143,7 +33158,8 @@ pub mod unit_testing { let mut writer = reply.with_command(1u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_add_arguments( + let cmd_invoke_result = ::handle_test_add_arguments( + &self.0, &ctx, cmd_data, rs_matter_crate::tlv::TLVBuilder::new( @@ -29157,7 +33173,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29206,21 +33223,24 @@ pub mod unit_testing { let mut writer = reply.with_command(2u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_simple_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestSimpleArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_simple_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestSimpleArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29269,21 +33289,24 @@ pub mod unit_testing { let mut writer = reply.with_command(3u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_struct_array_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestStructArrayArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_struct_array_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestStructArrayArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29332,21 +33355,24 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_struct_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestStructArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_struct_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestStructArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29395,21 +33421,24 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_nested_struct_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestNestedStructArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_nested_struct_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestNestedStructArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29458,21 +33487,24 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_list_struct_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestListStructArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_list_struct_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestListStructArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29521,21 +33553,24 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_list_int_8_u_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestListInt8UArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_list_int_8_u_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestListInt8UArgumentRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29584,21 +33619,26 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_nested_struct_list_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestNestedStructListArgumentRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_nested_struct_list_argument_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug( + CommandId::TestNestedStructListArgumentRequest, + ), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29647,24 +33687,7 @@ pub mod unit_testing { let mut writer = reply.with_command(8u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = - self.0.handle_test_list_nested_struct_list_argument_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug( - CommandId::TestListNestedStructListArgumentRequest, - ), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = < T as ClusterHandler > :: handle_test_list_nested_struct_list_argument_request (& self . 0 , & ctx , cmd_data , rs_matter_crate :: tlv :: TLVBuilder :: new (rs_matter_crate :: tlv :: TLVWriteParent :: new (MetadataDebug ((ctx . cmd () . endpoint_id , self , MetadataDebug (CommandId :: TestListNestedStructListArgumentRequest))) , tw) , tag ,) ?) . await ; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29713,21 +33736,24 @@ pub mod unit_testing { let mut writer = reply.with_command(4u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_list_int_8_u_reverse_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestListInt8UReverseRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_list_int_8_u_reverse_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestListInt8UReverseRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29776,7 +33802,8 @@ pub mod unit_testing { let mut writer = reply.with_command(5u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_enums_request( + let cmd_invoke_result = ::handle_test_enums_request( + &self.0, &ctx, cmd_data, rs_matter_crate::tlv::TLVBuilder::new( @@ -29790,7 +33817,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29839,21 +33867,24 @@ pub mod unit_testing { let mut writer = reply.with_command(6u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_nullable_optional_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestNullableOptionalRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_nullable_optional_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestNullableOptionalRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29902,21 +33933,26 @@ pub mod unit_testing { let mut writer = reply.with_command(7u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_complex_nullable_optional_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestComplexNullableOptionalRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_complex_nullable_optional_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug( + CommandId::TestComplexNullableOptionalRequest, + ), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -29965,21 +34001,24 @@ pub mod unit_testing { let mut writer = reply.with_command(9u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_simple_struct_echo_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::SimpleStructEchoRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_simple_struct_echo_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::SimpleStructEchoRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30004,7 +34043,8 @@ pub mod unit_testing { rs_matter_crate::dm::Reply::complete(writer)? } CommandId::TimedInvokeRequest => { - let cmd_invoke_result = self.0.handle_timed_invoke_request(&ctx); + let cmd_invoke_result = + ::handle_timed_invoke_request(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -30030,9 +34070,13 @@ pub mod unit_testing { CommandId::TestSimpleOptionalArgumentRequest => { let cmd_data: TestSimpleOptionalArgumentRequestRequest<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let cmd_invoke_result = self - .0 - .handle_test_simple_optional_argument_request(&ctx, cmd_data.clone()); + let cmd_invoke_result = + ::handle_test_simple_optional_argument_request( + &self.0, + &ctx, + cmd_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -30082,21 +34126,24 @@ pub mod unit_testing { let mut writer = reply.with_command(10u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_emit_test_event_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestEmitTestEventRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_emit_test_event_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestEmitTestEventRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30146,7 +34193,8 @@ pub mod unit_testing { let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); let cmd_invoke_result = - self.0.handle_test_emit_test_fabric_scoped_event_request( + ::handle_test_emit_test_fabric_scoped_event_request( + &self.0, &ctx, cmd_data, rs_matter_crate::tlv::TLVBuilder::new( @@ -30162,7 +34210,8 @@ pub mod unit_testing { ), tag, )?, - ); + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30211,21 +34260,24 @@ pub mod unit_testing { let mut writer = reply.with_command(12u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_batch_helper_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestBatchHelperRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_batch_helper_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestBatchHelperRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30274,21 +34326,24 @@ pub mod unit_testing { let mut writer = reply.with_command(12u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_second_batch_helper_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestSecondBatchHelperRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_second_batch_helper_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestSecondBatchHelperRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30337,21 +34392,24 @@ pub mod unit_testing { let mut writer = reply.with_command(4294049979u32)?; let tag = rs_matter_crate::dm::Reply::tag(&writer); let tw = rs_matter_crate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.handle_test_different_vendor_mei_request( - &ctx, - cmd_data, - rs_matter_crate::tlv::TLVBuilder::new( - rs_matter_crate::tlv::TLVWriteParent::new( - MetadataDebug(( - ctx.cmd().endpoint_id, - self, - MetadataDebug(CommandId::TestDifferentVendorMeiRequest), - )), - tw, - ), - tag, - )?, - ); + let cmd_invoke_result = + ::handle_test_different_vendor_mei_request( + &self.0, + &ctx, + cmd_data, + rs_matter_crate::tlv::TLVBuilder::new( + rs_matter_crate::tlv::TLVWriteParent::new( + MetadataDebug(( + ctx.cmd().endpoint_id, + self, + MetadataDebug(CommandId::TestDifferentVendorMeiRequest), + )), + tw, + ), + tag, + )?, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} (end) -> {:?}", @@ -30386,6 +34444,12 @@ pub mod unit_testing { self.0.dataver_changed(); Ok(()) } + fn run( + &self, + ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> { + self.0.run(ctx) + } } impl core::fmt::Debug for MetadataDebug<(u16, &HandlerAdaptor, Q)> where @@ -30419,7 +34483,6 @@ pub mod unit_testing { ) } } - impl rs_matter_crate::dm::NonBlockingHandler for HandlerAdaptor where T: ClusterHandler {} } "#; } diff --git a/rs-matter-macros/src/idl/handler.rs b/rs-matter-macros/src/idl/handler.rs index 2642a9d1e..f20073716 100644 --- a/rs-matter-macros/src/idl/handler.rs +++ b/rs-matter-macros/src/idl/handler.rs @@ -26,10 +26,21 @@ use super::id::{ident, idl_attribute_name_to_enum_variant_name, idl_field_name_t use super::parser::{Attribute, Cluster, Command, DataType, Entities, EntityContext, StructType}; use super::IdlGenerateContext; +/// Type of handler to be generated +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] +pub enum HandlerType { + /// Non-async methods + Sync, + /// Standard handler + Handler, + /// An inherent implementation of the trait over `&T`, where `T` is assumed to implement the trait + Delegate, +} + /// Return a token stream defining the handler trait for the provided IDL cluster. /// -/// Unlike the `rs-matter` generic `Handler` / `AsyncHandler` pair of traits, the trait -/// generated here is specific to the conrete provided IDL cluster and is strongly-typed. +/// Unlike the `rs-matter` generic `AsyncHandler` pair of traits, the trait +/// generated here is specific to the concrete provided IDL cluster and is strongly-typed. /// /// Thus, it contains methods corresponding to all the attributes and commands of the /// IDL cluster. @@ -39,59 +50,47 @@ use super::IdlGenerateContext; /// in the IDL cluster, thus providing a strongly-typed interface. /// /// ## Arguments -/// - `asynch`: If true, the generated handler will be async. -/// - `delegate`: If true, rather than generating a handler trait, the function will generate -/// an inherent implementation of the trait over `&T`, where `T` is assumed to implement the trait. +/// - `handler_type`: The type of handler /// - `cluster`: The IDL cluster for which the handler is generated. /// - `context`: The context containing the information needed to generate the handler. pub fn handler( - asynch: bool, - delegate: bool, + handler_type: HandlerType, cluster: &Cluster, globals: &Entities, context: &IdlGenerateContext, ) -> TokenStream { let krate = context.rs_matter_crate.clone(); - let handler_name = ident(&format!( - "Cluster{}Handler", - if asynch { "Async" } else { "" } - )); - let entities = &EntityContext::new(Some(&cluster.entities), globals); let handler_attribute_methods = cluster .attributes .iter() .filter(|attr| !GLOBAL_ATTR.contains(&attr.field.field.code)) - .map(|attr| handler_attribute(attr, asynch, delegate, entities, &krate)); + .map(|attr| handler_attribute(attr, handler_type, entities, &krate)); let handler_attribute_write_methods = cluster .attributes .iter() .filter(|attr| !GLOBAL_ATTR.contains(&attr.field.field.code)) .filter(|attr| !attr.is_read_only) - .map(|attr| handler_attribute_write(attr, asynch, delegate, entities, &krate)); + .map(|attr| handler_attribute_write(attr, handler_type, entities, &krate)); let handler_command_methods = cluster .commands .iter() - .map(|cmd| handler_command(cmd, asynch, delegate, entities, &krate)); + .map(|cmd| handler_command(cmd, handler_type, entities, &krate)); - if delegate { - let run = if asynch { - quote!( - fn run(&self, ctx: impl #krate::dm::HandlerContext) -> impl core::future::Future> { - (**self).run(ctx) - } - ) - } else { - quote!() - }; + if handler_type == HandlerType::Delegate { + let run = quote!( + fn run(&self, ctx: impl #krate::dm::HandlerContext) -> impl core::future::Future> { + (**self).run(ctx) + } + ); quote!( - impl #handler_name for &T + impl ClusterHandler for &T where - T: #handler_name + T: ClusterHandler { const CLUSTER: #krate::dm::Cluster<'static> = T::CLUSTER; @@ -106,29 +105,34 @@ pub fn handler( #(#handler_command_methods)* } + + impl ClusterSyncHandler for &T where T: ClusterSyncHandler {} ) } else { - let run = if asynch { - quote!( + let (metadata, definition); + if handler_type == HandlerType::Handler { + metadata = quote!( + #[doc = "The cluster-metadata corresponding to this handler trait."] + const CLUSTER: #krate::dm::Cluster<'static>; + + fn dataver(&self) -> u32; + + fn dataver_changed(&self); + fn run(&self, _ctx: impl #krate::dm::HandlerContext) -> impl core::future::Future> { core::future::pending::>() } - ) + ); + definition = quote!(ClusterHandler : ClusterSyncHandler); } else { - quote!() + metadata = quote!(); + definition = quote!(ClusterSyncHandler); }; quote!( #[doc = "The handler trait for the cluster."] - pub trait #handler_name { - #[doc = "The cluster-metadata corresponding to this handler trait."] - const CLUSTER: #krate::dm::Cluster<'static>; - - fn dataver(&self) -> u32; - - fn dataver_changed(&self); - - #run + pub trait #definition { + #metadata #(#handler_attribute_methods)* @@ -142,18 +146,16 @@ pub fn handler( /// Return a token stream defining an adaptor struct that can adapt a type implementing the /// cluster-specific handler trait as defined by the `handler` function to the -/// generic `Handler` / `AsyncHandler` traits that `rs-matter` understands. +/// generic `AsyncHandler` traits that `rs-matter` understands. /// /// Without this adaptor, implementations of the cluster-specific handler trait would not be /// usable with `rs-matter`. /// /// # Arguments -/// - `asynch`: If true, the adaptor implements to rs-matter's `AsyncHandler` trait, rather than /// to the `Handler` trait. /// - `cluster`: The IDL cluster for which the adaptor is generated. /// - `context`: The context containing the information needed to generate the adaptor. pub fn handler_adaptor( - asynch: bool, cluster: &Cluster, globals: &Entities, context: &IdlGenerateContext, @@ -163,24 +165,12 @@ pub fn handler_adaptor( let cluster_name_str = Literal::string(&cluster.id); let cluster_code = Literal::u32_suffixed(cluster.code as _); - let handler_name = ident(&format!( - "Cluster{}Handler", - if asynch { "Async" } else { "" } - )); - - let handler_adaptor_name = ident(&format!( - "Handler{}Adaptor", - if asynch { "Async" } else { "" } - )); - - let generic_handler_name = ident(&format!("{}Handler", if asynch { "Async" } else { "" })); - let entities = &EntityContext::new(Some(&cluster.entities), globals); let handler_adaptor_attribute_match = cluster .attributes .iter() .filter(|attr| !GLOBAL_ATTR.contains(&attr.field.field.code)) - .map(|attr| handler_adaptor_attribute_match(attr, asynch, entities, &krate)) + .map(|attr| handler_adaptor_attribute_match(attr, entities, &krate)) .collect::>(); let handler_adaptor_attribute_write_match = cluster @@ -188,12 +178,12 @@ pub fn handler_adaptor( .iter() .filter(|attr| !GLOBAL_ATTR.contains(&attr.field.field.code)) .filter(|attr| !attr.is_read_only) - .map(|attr| handler_adaptor_attribute_write_match(attr, asynch, entities, &krate)); + .map(|attr| handler_adaptor_attribute_write_match(attr, entities, &krate)); let handler_adaptor_command_match = cluster .commands .iter() - .map(|cmd| handler_adaptor_command_match(cmd, asynch, entities, &krate)) + .map(|cmd| handler_adaptor_command_match(cmd, entities, &krate)) .collect::>(); let read_stream = if !handler_adaptor_attribute_match.is_empty() { @@ -272,30 +262,24 @@ pub fn handler_adaptor( ) }; - let run = if asynch { - quote!( - fn run(&self, ctx: impl #krate::dm::HandlerContext) -> impl core::future::Future> { - self.0.run(ctx) - } - ) - } else { - quote!() - }; - - let pasync = if asynch { quote!(async) } else { quote!() }; + let run = quote!( + fn run(&self, ctx: impl #krate::dm::HandlerContext) -> impl core::future::Future> { + self.0.run(ctx) + } + ); let stream = quote!( #[doc = "The handler adaptor for the cluster-specific handler. This adaptor implements the generic `rs-matter` handler trait."] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[cfg_attr(feature = "defmt", derive(#krate::reexport::defmt::Format))] - pub struct #handler_adaptor_name(pub T); + pub struct HandlerAdaptor(pub T); - impl #krate::dm::#generic_handler_name for #handler_adaptor_name + impl #krate::dm::AsyncHandler for HandlerAdaptor where - T: #handler_name, + T: ClusterHandler, { #[allow(unreachable_code)] - #pasync fn read( + async fn read( &self, ctx: impl #krate::dm::ReadContext, reply: impl #krate::dm::ReadReply, @@ -312,7 +296,7 @@ pub fn handler_adaptor( } #[allow(unreachable_code)] - #pasync fn write( + async fn write( &self, ctx: impl #krate::dm::WriteContext, ) -> Result<(), #krate::error::Error> { @@ -330,7 +314,7 @@ pub fn handler_adaptor( } #[allow(unreachable_code)] - #pasync fn invoke( + async fn invoke( &self, ctx: impl #krate::dm::InvokeContext, reply: impl #krate::dm::InvokeReply, @@ -345,9 +329,9 @@ pub fn handler_adaptor( #run } - impl core::fmt::Debug for MetadataDebug<(u16, &#handler_adaptor_name, Q)> + impl core::fmt::Debug for MetadataDebug<(u16, &HandlerAdaptor, Q)> where - T: #handler_name, + T: ClusterHandler, Q: core::fmt::Debug, { #[allow(unreachable_code)] @@ -357,9 +341,9 @@ pub fn handler_adaptor( } #[cfg(feature = "defmt")] - impl #krate::reexport::defmt::Format for MetadataDebug<(u16, &#handler_adaptor_name, Q)> + impl #krate::reexport::defmt::Format for MetadataDebug<(u16, &HandlerAdaptor, Q)> where - T: #handler_name, + T: ClusterHandler, Q: #krate::reexport::defmt::Format, { #[allow(unreachable_code)] @@ -369,44 +353,25 @@ pub fn handler_adaptor( } ); - if asynch { - stream - } else { - quote!( - #stream - - impl #krate::dm::NonBlockingHandler for #handler_adaptor_name - where - T: #handler_name, - {} - ) - } + stream } /// Return a token stream defining the handler trait method for reading the provided IDL attribute. /// /// # Arguments /// - `attr`: The IDL attribute for which the handler method is generated. -/// - `asynch`: If true, the generated handler method signature will be async. -/// - `delegate`: If true, the generated handler method will have an implementation delegating -/// to a `T` type (for inherent impls) +/// - `handler_type`: The type of handler /// - `cluster`: The IDL cluster for which the handler method is generated. /// - `krate`: The crate name to use for the generated code. fn handler_attribute( attr: &Attribute, - asynch: bool, - delegate: bool, + handler_type: HandlerType, entities: &EntityContext, krate: &Ident, ) -> TokenStream { let attr_name = ident(&idl_field_name_to_rs_name(&attr.field.field.id)); let parent = quote!(P); - let (pasync, sawait) = if asynch { - (quote!(async), quote!(.await)) - } else { - (quote!(), quote!()) - }; let (mut attr_type, builder) = field_type_builder( &attr.field.field.data_type, @@ -418,6 +383,7 @@ fn handler_attribute( krate, ); + let (definition, result_type, builder_param); if builder { if attr.field.field.data_type.is_list { let (attr_element_type, _) = field_type_builder( @@ -437,38 +403,48 @@ fn handler_attribute( attr_type = quote!(#krate::dm::ArrayAttributeRead<#attr_type, #attr_element_type>); } - if !delegate && attr.field.is_optional { - quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::ReadContext, builder: #attr_type) -> Result { - Err(#krate::error::ErrorCode::InvalidAction.into()) - } - ) - } else { - let stream = quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::ReadContext, builder: #attr_type) -> Result - ); + definition = quote!( + fn #attr_name(&self, ctx: impl #krate::dm::ReadContext, builder: #attr_type) + ); + result_type = quote!(Result); + builder_param = quote!(, builder); + } else { + definition = quote!(fn #attr_name(&self, ctx: impl #krate::dm::ReadContext)); + result_type = quote!(Result<#attr_type, #krate::error::Error>); + builder_param = quote!(); + } - if delegate { - quote!(#stream { T::#attr_name(self, ctx, builder)#sawait }) + let async_definition = quote!(#definition -> impl core::future::Future); + match handler_type { + HandlerType::Sync => { + let sync_definition = quote!(#definition -> #result_type); + if attr.field.is_optional { + quote!( + #sync_definition { + Err(#krate::error::ErrorCode::InvalidAction.into()) + } + ) } else { - quote!(#stream;) + let error_msg = format!("You must implement {}", definition); + quote!( + #sync_definition { + const { core::panic!(#error_msg); } + }) } } - } else if !delegate && attr.field.is_optional { - quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::ReadContext) -> Result<#attr_type, #krate::error::Error> { - Err(#krate::error::ErrorCode::InvalidAction.into()) - } - ) - } else { - let stream = quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::ReadContext) -> Result<#attr_type, #krate::error::Error> - ); - - if delegate { - quote!(#stream { T::#attr_name(self, ctx)#sawait }) - } else { - quote!(#stream;) + HandlerType::Delegate => { + quote!( + #async_definition { + ::#attr_name(self, ctx #builder_param) + } + ) + } + HandlerType::Handler => { + quote!( + #async_definition { + core::future::ready(::#attr_name(self, ctx #builder_param)) + } + ) } } } @@ -477,15 +453,12 @@ fn handler_attribute( /// /// # Arguments /// - `attr`: The IDL attribute for which the handler method is generated. -/// - `asynch`: If true, the generated handler method signature will be async. -/// - `delegate`: If true, the generated handler method will have an implementation delegating -/// to a `T` type (for inherent impls) +/// - `handler_type`: The type of handler /// - `cluster`: The IDL cluster for which the handler method is generated. /// - `krate`: The crate name to use for the generated code. fn handler_attribute_write( attr: &Attribute, - asynch: bool, - delegate: bool, + handler_type: HandlerType, entities: &EntityContext, krate: &Ident, ) -> TokenStream { @@ -494,12 +467,6 @@ fn handler_attribute_write( &idl_field_name_to_rs_name(&attr.field.field.id) )); - let (pasync, sawait) = if asynch { - (quote!(async), quote!(.await)) - } else { - (quote!(), quote!()) - }; - let mut attr_type = field_type( &attr.field.field.data_type, attr.field.is_nullable, @@ -524,21 +491,40 @@ fn handler_attribute_write( attr_type = quote!(#krate::dm::ArrayAttributeWrite<#attr_type, #attr_element_type>); } - if !delegate && attr.field.is_optional { - quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::WriteContext, value: #attr_type) -> Result<(), #krate::error::Error> { - Err(#krate::error::ErrorCode::InvalidAction.into()) + let definition = + quote!(fn #attr_name(&self, ctx: impl #krate::dm::WriteContext, value: #attr_type)); + let result_type = quote!(Result<(), #krate::error::Error>); + let async_definition = quote!(#definition -> impl core::future::Future); + match handler_type { + HandlerType::Sync => { + let sync_definition = quote!(#definition -> #result_type); + if attr.field.is_optional { + quote!( + #sync_definition { + Err(#krate::error::ErrorCode::InvalidAction.into()) + } + ) + } else { + let error_msg = format!("You must implement {}", definition); + quote!( + #sync_definition { + const { core::panic!(#error_msg); } + }) } - ) - } else { - let stream = quote!( - #pasync fn #attr_name(&self, ctx: impl #krate::dm::WriteContext, value: #attr_type) -> Result<(), #krate::error::Error> - ); - - if delegate { - quote!(#stream { T::#attr_name(self, ctx, value)#sawait }) - } else { - quote!(#stream;) + } + HandlerType::Delegate => { + quote!( + #async_definition { + ::#attr_name(self, ctx, value) + } + ) + } + HandlerType::Handler => { + quote!( + #async_definition { + core::future::ready(::#attr_name(self, ctx, value)) + } + ) } } } @@ -547,26 +533,18 @@ fn handler_attribute_write( /// /// # Arguments /// - `cmd`: The IDL command for which the handler method is generated. -/// - `asynch`: If true, the generated handler method signature will be async. -/// - `delegate`: If true, the generated handler method will have an implementation delegating +/// - `handler_type`: The type of handler /// to a `T` type (for inherent impls) /// - `cluster`: The IDL cluster for which the handler method is generated. /// - `krate`: The crate name to use for the generated code. fn handler_command( cmd: &Command, - asynch: bool, - delegate: bool, + handler_type: HandlerType, entities: &EntityContext, krate: &Ident, ) -> TokenStream { let cmd_name = ident(&format!("handle_{}", &idl_field_name_to_rs_name(&cmd.id))); - let (pasync, sawait) = if asynch { - (quote!(async), quote!(.await)) - } else { - (quote!(), quote!()) - }; - let field_req = cmd.input.as_ref().map(|id| { field_type( &DataType { @@ -599,94 +577,95 @@ fn handler_command( ) }); + let (result_type, definition, request_param, response_param); if let Some(field_req) = field_req { if let Some((field_resp, field_resp_builder)) = field_resp { if field_resp_builder { - let stream = quote!( - #pasync fn #cmd_name( + definition = quote!( + fn #cmd_name( &self, ctx: impl #krate::dm::InvokeContext, request: #field_req, response: #field_resp, - ) -> Result + ) ); - if delegate { - quote!(#stream { T::#cmd_name(self, ctx, request, response)#sawait }) - } else { - quote!(#stream;) - } + result_type = quote!(Result); + request_param = quote!(, request); + response_param = quote!(, response); } else { - let stream = quote!( - #pasync fn #cmd_name( + definition = quote!( + fn #cmd_name( &self, ctx: impl #krate::dm::InvokeContext, request: #field_req, - ) -> Result<#field_resp, #krate::error::Error> + ) ); - if delegate { - quote!(#stream { T::#cmd_name(self, ctx, request)#sawait }) - } else { - quote!(#stream;) - } + result_type = quote!(Result<#field_resp, #krate::error::Error>); + request_param = quote!(, request); + response_param = quote!(); } } else { - let stream = quote!( - #pasync fn #cmd_name( + definition = quote!( + fn #cmd_name( &self, ctx: impl #krate::dm::InvokeContext, request: #field_req, - ) -> Result<(), #krate::error::Error> + ) ); - if delegate { - quote!(#stream { T::#cmd_name(self, ctx, request)#sawait }) - } else { - quote!(#stream;) - } + result_type = quote!(Result<(), #krate::error::Error>); + request_param = quote!(, request); + response_param = quote!(); } } else if let Some((field_resp, field_resp_builder)) = field_resp { if field_resp_builder { - let stream = quote!( - #pasync fn #cmd_name( + definition = quote!( + fn #cmd_name( &self, ctx: impl #krate::dm::InvokeContext, response: #field_resp, - ) -> Result + ) ); - if delegate { - quote!(#stream { T::#cmd_name(self, ctx, response)#sawait }) - } else { - quote!(#stream;) - } + result_type = quote!(Result); + request_param = quote!(); + response_param = quote!(, response); } else { - let stream = quote!( - #pasync fn #cmd_name( - &self, - ctx: impl #krate::dm::InvokeContext, - ) -> Result<#field_resp, #krate::error::Error> - ); - - if delegate { - quote!(#stream { T::#cmd_name(self, ctx)#sawait }) - } else { - quote!(#stream;) - } + definition = quote!(fn #cmd_name(&self, ctx: impl #krate::dm::InvokeContext)); + result_type = quote!(Result<#field_resp, #krate::error::Error>); + request_param = quote!(); + response_param = quote!(); } } else { - let stream = quote!( - #pasync fn #cmd_name( - &self, - ctx: impl #krate::dm::InvokeContext, - ) -> Result<(), #krate::error::Error> - ); - - if delegate { - quote!(#stream { T::#cmd_name(self, ctx)#sawait }) - } else { - quote!(#stream;) + definition = quote!(fn #cmd_name(&self, ctx: impl #krate::dm::InvokeContext)); + result_type = quote!(Result<(), #krate::error::Error>); + request_param = quote!(); + response_param = quote!(); + } + let async_definition = quote!(#definition -> impl core::future::Future); + match handler_type { + HandlerType::Sync => { + let error_msg = format!("You must implement {}", definition); + quote!( + #definition -> #result_type { + const { core::panic!(#error_msg); } + }) + } + HandlerType::Delegate => { + quote!( + #async_definition { + ::#cmd_name(self, ctx #request_param #response_param) + } + ) + } + HandlerType::Handler => { + quote!( + #async_definition { + core::future::ready(::#cmd_name(self, ctx #request_param #response_param)) + } + ) } } } @@ -696,12 +675,10 @@ fn handler_command( /// /// # Arguments /// - `attr`: The IDL attribute for which the match clause is generated. -/// - `asynch`: If true, the generated match clause will assume the cluster trait is async and will generate async code. /// - `cluster`: The IDL cluster for which the match clause is generated. /// - `krate`: The crate name to use for the generated code. fn handler_adaptor_attribute_match( attr: &Attribute, - asynch: bool, entities: &EntityContext, krate: &Ident, ) -> TokenStream { @@ -713,7 +690,6 @@ fn handler_adaptor_attribute_match( let attr_method_name = ident(&idl_field_name_to_rs_name(&attr.field.field.id)); let parent = quote!(P); - let sawait = if asynch { quote!(.await) } else { quote!() }; let (_, builder) = field_type_builder( &attr.field.field.data_type, @@ -755,14 +731,15 @@ fn handler_adaptor_attribute_match( let tag = #krate::dm::Reply::tag(&writer); let tw = #krate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.#attr_method_name( + let attr_read_result = ::#attr_method_name( + &self.0, &ctx, #krate::dm::ArrayAttributeRead::new( ctx.attr().list_index.clone(), #krate::tlv::TLVWriteParent::new(#attr_debug_id, tw), tag, )?, - )#sawait; + ).await; #attr_read_debug_build_end @@ -779,10 +756,10 @@ fn handler_adaptor_attribute_match( let tag = #krate::dm::Reply::tag(&writer); let tw = #krate::dm::Reply::writer(&mut writer); - let attr_read_result = self.0.#attr_method_name(&ctx, #krate::tlv::TLVBuilder::new( + let attr_read_result = ::#attr_method_name(&self.0, &ctx, #krate::tlv::TLVBuilder::new( #krate::tlv::TLVWriteParent::new(#attr_debug_id, tw), tag, - )?)#sawait; + )?).await; #attr_read_debug_build_end @@ -795,7 +772,7 @@ fn handler_adaptor_attribute_match( } else { quote!( AttributeId::#attr_name => { - let attr_read_result = self.0.#attr_method_name(&ctx)#sawait; + let attr_read_result = ::#attr_method_name(&self.0, &ctx).await; #attr_read_debug @@ -810,11 +787,9 @@ fn handler_adaptor_attribute_match( /// /// # Arguments /// - `attr`: The IDL attribute for which the match clause is generated. -/// - `asynch`: If true, the generated match clause will assume the cluster trait is async and will generate async code. /// - `krate`: The crate name to use for the generated code. fn handler_adaptor_attribute_write_match( attr: &Attribute, - asynch: bool, entities: &EntityContext, krate: &Ident, ) -> TokenStream { @@ -836,8 +811,6 @@ fn handler_adaptor_attribute_write_match( krate, ); - let sawait = if asynch { quote!(.await) } else { quote!() }; - let attr_write_debug = quote!( #[cfg(feature = "defmt")] #krate::reexport::defmt::debug!("{:?}({:?}) -> {:?}", #attr_debug_id, attr_data, attr_write_result); @@ -850,7 +823,7 @@ fn handler_adaptor_attribute_write_match( AttributeId::#attr_name => { let attr_data = #krate::dm::ArrayAttributeWrite::new(ctx.attr().list_index.clone(), ctx.data())?; - let attr_write_result = self.0.#attr_method_name(&ctx, attr_data.clone())#sawait; + let attr_write_result = ::#attr_method_name(&self.0, &ctx, attr_data.clone()).await; #attr_write_debug @@ -862,7 +835,7 @@ fn handler_adaptor_attribute_write_match( AttributeId::#attr_name => { let attr_data: #attr_type = #krate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.#attr_method_name(&ctx, attr_data.clone())#sawait; + let attr_write_result = ::#attr_method_name(&self.0, &ctx, attr_data.clone()).await; #attr_write_debug @@ -877,12 +850,10 @@ fn handler_adaptor_attribute_write_match( /// /// # Arguments /// - `cmd`: The IDL command for which the match clause is generated. -/// - `asynch`: If true, the generated match clause will assume the cluster trait is async and will generate async code. /// - `cluster`: The IDL cluster for which the match clause is generated. /// - `krate`: The crate name to use for the generated code. fn handler_adaptor_command_match( cmd: &Command, - asynch: bool, entities: &EntityContext, krate: &Ident, ) -> TokenStream { @@ -892,8 +863,6 @@ fn handler_adaptor_command_match( let cmd_method_name = ident(&format!("handle_{}", &idl_field_name_to_rs_name(&cmd.id))); - let sawait = if asynch { quote!(.await) } else { quote!() }; - let cmd_invoke_debug_build_start = quote!( #[cfg(feature = "defmt")] #krate::reexport::defmt::debug!("{:?}({:?}) -> (build) +", #cmd_debug_id, cmd_data); @@ -991,14 +960,15 @@ fn handler_adaptor_command_match( let tag = #krate::dm::Reply::tag(&writer); let tw = #krate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.#cmd_method_name( + let cmd_invoke_result = ::#cmd_method_name( + &self.0, &ctx, cmd_data, #krate::tlv::TLVBuilder::new( #krate::tlv::TLVWriteParent::new(#cmd_debug_id, tw), tag, )? - )#sawait; + ).await; #cmd_invoke_debug_build_end @@ -1014,7 +984,8 @@ fn handler_adaptor_command_match( let writer = reply.with_command(#field_resp_cmd_code)?; - let cmd_invoke_result = self.0.#cmd_method_name(&ctx, cmd_data.clone())#sawait; + let cmd_invoke_result = ::#cmd_method_name( + &self.0, &ctx, cmd_data.clone()).await; #cmd_invoke_debug @@ -1027,7 +998,8 @@ fn handler_adaptor_command_match( CommandId::#cmd_name => { let cmd_data: #field_req = #krate::tlv::FromTLV::from_tlv(ctx.data())?; - let cmd_invoke_result = self.0.#cmd_method_name(&ctx, cmd_data.clone())#sawait; + let cmd_invoke_result = ::#cmd_method_name( + &self.0, &ctx, cmd_data.clone()).await; #cmd_invoke_debug @@ -1045,13 +1017,14 @@ fn handler_adaptor_command_match( let tag = #krate::dm::Reply::tag(&writer); let tw = #krate::dm::Reply::writer(&mut writer); - let cmd_invoke_result = self.0.#cmd_method_name( + let cmd_invoke_result = ::#cmd_method_name( + &self.0, &ctx, #krate::tlv::TLVBuilder::new( #krate::tlv::TLVWriteParent::new(#cmd_debug_id, tw), tag, )?, - )#sawait; + ).await; #cmd_invoke_debug_build_end @@ -1065,7 +1038,7 @@ fn handler_adaptor_command_match( CommandId::#cmd_name => { let writer = reply.with_command(#field_resp_cmd_code)?; - let cmd_invoke_result = self.0.#cmd_method_name(&ctx)#sawait; + let cmd_invoke_result = ::#cmd_method_name(&self.0, &ctx).await; #cmd_invoke_debug_noarg @@ -1076,7 +1049,7 @@ fn handler_adaptor_command_match( } else { quote!( CommandId::#cmd_name => { - let cmd_invoke_result = self.0.#cmd_method_name(&ctx)#sawait; + let cmd_invoke_result = ::#cmd_method_name(&self.0, &ctx).await; #cmd_invoke_debug_noarg @@ -1088,6 +1061,7 @@ fn handler_adaptor_command_match( #[cfg(test)] mod tests { + use crate::idl::handler::HandlerType; use assert_tokenstreams_eq::assert_tokenstreams_eq; use quote::quote; @@ -1177,103 +1151,157 @@ mod tests { let cluster = get_cluster_named(&idl, "OnOff").expect("Cluster exists"); let context = IdlGenerateContext::new("rs_matter_crate"); - // panic!("====\n{}\n====", &handler(false, false, cluster, &context)); + // panic!("====\n{}\n====", &handler(HandlerType::Handler, cluster, &idl.globals, &context)); assert_tokenstreams_eq!( - &handler(false, false, cluster, &idl.globals, &context), + &handler(HandlerType::Handler, cluster, &idl.globals, &context), "e!( #[doc = "The handler trait for the cluster."] - pub trait ClusterHandler { + pub trait ClusterHandler: ClusterSyncHandler { #[doc = "The cluster-metadata corresponding to this handler trait."] const CLUSTER: rs_matter_crate::dm::Cluster<'static>; fn dataver(&self) -> u32; fn dataver_changed(&self); + fn run( + &self, + _ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> + { + core::future::pending::>() + } fn on_off( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result; + ) -> impl core::future::Future> + { + core::future::ready(::on_off(self, ctx)) + } fn global_scene_control( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::global_scene_control( + self, ctx, + )) } fn on_time( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::on_time(self, ctx)) } fn off_wait_time( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::off_wait_time(self, ctx)) } fn start_up_on_off( &self, ctx: impl rs_matter_crate::dm::ReadContext, - ) -> Result< - rs_matter_crate::tlv::Nullable, - rs_matter_crate::error::Error, + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, > { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + core::future::ready(::start_up_on_off( + self, ctx, + )) } fn set_on_time( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::set_on_time( + self, ctx, value, + )) } fn set_off_wait_time( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, - ) -> Result<(), rs_matter_crate::error::Error> { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::set_off_wait_time( + self, ctx, value, + )) } fn set_start_up_on_off( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, - ) -> Result<(), rs_matter_crate::error::Error> { - Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) + ) -> impl core::future::Future> + { + core::future::ready(::set_start_up_on_off( + self, ctx, value, + )) } fn handle_off( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready(::handle_off(self, ctx)) + } fn handle_on( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready(::handle_on(self, ctx)) + } fn handle_toggle( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready(::handle_toggle(self, ctx)) + } fn handle_off_with_effect( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: OffWithEffectRequest<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready(::handle_off_with_effect( + self, ctx, request, + )) + } fn handle_on_with_recall_global_scene( &self, ctx: impl rs_matter_crate::dm::InvokeContext, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready( + ::handle_on_with_recall_global_scene( + self, ctx, + ), + ) + } fn handle_on_with_timed_off( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: OnWithTimedOffRequest<'_>, - ) -> Result<(), rs_matter_crate::error::Error>; + ) -> impl core::future::Future> + { + core::future::ready(::handle_on_with_timed_off( + self, ctx, request, + )) + } } ) ); - // panic!("====\n{}\n====", &handler(false, true, cluster, &context)); + // panic!("====\n{}\n====", &handler(HandlerType::Delegate, cluster, &idl.globals, &context)); assert_tokenstreams_eq!( - &handler(false, true, cluster, &idl.globals, &context), + &handler(HandlerType::Delegate, cluster, &idl.globals, &context), "e!( impl ClusterHandler for &T where @@ -1286,29 +1314,157 @@ mod tests { fn dataver_changed(&self) { T::dataver_changed(self) } + fn run( + &self, + ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> + { + (**self).run(ctx) + } + fn on_off( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> impl core::future::Future> + { + ::on_off(self, ctx) + } + fn global_scene_control( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> impl core::future::Future> + { + ::global_scene_control(self, ctx) + } + fn on_time( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> impl core::future::Future> + { + ::on_time(self, ctx) + } + fn off_wait_time( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> impl core::future::Future> + { + ::off_wait_time(self, ctx) + } + fn start_up_on_off( + &self, + ctx: impl rs_matter_crate::dm::ReadContext, + ) -> impl core::future::Future< + Output = Result< + rs_matter_crate::tlv::Nullable, + rs_matter_crate::error::Error, + >, + > { + ::start_up_on_off(self, ctx) + } + fn set_on_time( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> impl core::future::Future> + { + ::set_on_time(self, ctx, value) + } + fn set_off_wait_time( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: u16, + ) -> impl core::future::Future> + { + ::set_off_wait_time(self, ctx, value) + } + fn set_start_up_on_off( + &self, + ctx: impl rs_matter_crate::dm::WriteContext, + value: rs_matter_crate::tlv::Nullable, + ) -> impl core::future::Future> + { + ::set_start_up_on_off(self, ctx, value) + } + fn handle_off( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> impl core::future::Future> + { + ::handle_off(self, ctx) + } + fn handle_on( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> impl core::future::Future> + { + ::handle_on(self, ctx) + } + fn handle_toggle( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> impl core::future::Future> + { + ::handle_toggle(self, ctx) + } + fn handle_off_with_effect( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: OffWithEffectRequest<'_>, + ) -> impl core::future::Future> + { + ::handle_off_with_effect(self, ctx, request) + } + fn handle_on_with_recall_global_scene( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + ) -> impl core::future::Future> + { + ::handle_on_with_recall_global_scene(self, ctx) + } + fn handle_on_with_timed_off( + &self, + ctx: impl rs_matter_crate::dm::InvokeContext, + request: OnWithTimedOffRequest<'_>, + ) -> impl core::future::Future> + { + ::handle_on_with_timed_off(self, ctx, request) + } + } + impl ClusterSyncHandler for &T where T: ClusterSyncHandler {} + ) + ); + + // panic!("====\n{}\n====", &handler(HandlerType::Sync, cluster, &idl.globals, &context)); + + assert_tokenstreams_eq!( + &handler(HandlerType::Sync, cluster, &idl.globals, &context), + "e!( + #[doc = "The handler trait for the cluster."] + pub trait ClusterSyncHandler { fn on_off( &self, ctx: impl rs_matter_crate::dm::ReadContext, ) -> Result { - T::on_off(self, ctx) + const { + core::panic!("You must implement fn on_off (& self , ctx : impl rs_matter_crate :: dm :: ReadContext)"); + } } fn global_scene_control( &self, ctx: impl rs_matter_crate::dm::ReadContext, ) -> Result { - T::global_scene_control(self, ctx) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn on_time( &self, ctx: impl rs_matter_crate::dm::ReadContext, ) -> Result { - T::on_time(self, ctx) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn off_wait_time( &self, ctx: impl rs_matter_crate::dm::ReadContext, ) -> Result { - T::off_wait_time(self, ctx) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn start_up_on_off( &self, @@ -1317,66 +1473,78 @@ mod tests { rs_matter_crate::tlv::Nullable, rs_matter_crate::error::Error, > { - T::start_up_on_off(self, ctx) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn set_on_time( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, ) -> Result<(), rs_matter_crate::error::Error> { - T::set_on_time(self, ctx, value) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn set_off_wait_time( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: u16, ) -> Result<(), rs_matter_crate::error::Error> { - T::set_off_wait_time(self, ctx, value) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn set_start_up_on_off( &self, ctx: impl rs_matter_crate::dm::WriteContext, value: rs_matter_crate::tlv::Nullable, ) -> Result<(), rs_matter_crate::error::Error> { - T::set_start_up_on_off(self, ctx, value) + Err(rs_matter_crate::error::ErrorCode::InvalidAction.into()) } fn handle_off( &self, ctx: impl rs_matter_crate::dm::InvokeContext, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_off(self, ctx) + const { + core::panic!("You must implement fn handle_off (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } } fn handle_on( &self, ctx: impl rs_matter_crate::dm::InvokeContext, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_on(self, ctx) + const { + core::panic!("You must implement fn handle_on (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } } fn handle_toggle( &self, ctx: impl rs_matter_crate::dm::InvokeContext, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_toggle(self, ctx) + const { + core::panic!("You must implement fn handle_toggle (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } } fn handle_off_with_effect( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: OffWithEffectRequest<'_>, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_off_with_effect(self, ctx, request) + const { + core::panic!("You must implement fn handle_off_with_effect (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : OffWithEffectRequest < '_ > ,)"); + } } fn handle_on_with_recall_global_scene( &self, ctx: impl rs_matter_crate::dm::InvokeContext, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_on_with_recall_global_scene(self, ctx) + const { + core::panic!("You must implement fn handle_on_with_recall_global_scene (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext)"); + } } fn handle_on_with_timed_off( &self, ctx: impl rs_matter_crate::dm::InvokeContext, request: OnWithTimedOffRequest<'_>, ) -> Result<(), rs_matter_crate::error::Error> { - T::handle_on_with_timed_off(self, ctx, request) + const { + core::panic!("You must implement fn handle_on_with_timed_off (& self , ctx : impl rs_matter_crate :: dm :: InvokeContext , request : OnWithTimedOffRequest < '_ > ,)"); + } } } ) @@ -1390,21 +1558,21 @@ mod tests { let cluster = get_cluster_named(&idl, "OnOff").expect("Cluster exists"); let context = IdlGenerateContext::new("rs_matter_crate"); - // panic!("====\n{}\n====", &handler_adaptor(false, cluster, &context)); + // panic!("====\n{}\n====", &handler_adaptor( cluster, &idl.globals, &context)); assert_tokenstreams_eq!( - &handler_adaptor(false, cluster, &idl.globals, &context), + &handler_adaptor(cluster, &idl.globals, &context), "e!( #[doc = "The handler adaptor for the cluster-specific handler. This adaptor implements the generic `rs-matter` handler trait."] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[cfg_attr(feature = "defmt", derive(rs_matter_crate::reexport::defmt::Format))] pub struct HandlerAdaptor(pub T); - impl rs_matter_crate::dm::Handler for HandlerAdaptor + impl rs_matter_crate::dm::AsyncHandler for HandlerAdaptor where T: ClusterHandler, { #[allow(unreachable_code)] - fn read( + async fn read( &self, ctx: impl rs_matter_crate::dm::ReadContext, reply: impl rs_matter_crate::dm::ReadReply, @@ -1415,7 +1583,8 @@ mod tests { } else { match AttributeId::try_from(ctx.attr().attr_id)? { AttributeId::OnOff => { - let attr_read_result = self.0.on_off(&ctx); + let attr_read_result = + ::on_off(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1439,7 +1608,11 @@ mod tests { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::GlobalSceneControl => { - let attr_read_result = self.0.global_scene_control(&ctx); + let attr_read_result = + ::global_scene_control( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1469,7 +1642,8 @@ mod tests { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::OnTime => { - let attr_read_result = self.0.on_time(&ctx); + let attr_read_result = + ::on_time(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1493,7 +1667,9 @@ mod tests { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::OffWaitTime => { - let attr_read_result = self.0.off_wait_time(&ctx); + let attr_read_result = + ::off_wait_time(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1517,7 +1693,9 @@ mod tests { rs_matter_crate::dm::Reply::set(writer, attr_read_result?) } AttributeId::StartUpOnOff => { - let attr_read_result = self.0.start_up_on_off(&ctx); + let attr_read_result = + ::start_up_on_off(&self.0, &ctx) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1562,7 +1740,7 @@ mod tests { } } #[allow(unreachable_code)] - fn write( + async fn write( &self, ctx: impl rs_matter_crate::dm::WriteContext, ) -> Result<(), rs_matter_crate::error::Error> { @@ -1574,7 +1752,12 @@ mod tests { AttributeId::OnTime => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = self.0.set_on_time(&ctx, attr_data.clone()); + let attr_write_result = ::set_on_time( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -1602,8 +1785,12 @@ mod tests { AttributeId::OffWaitTime => { let attr_data: u16 = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_off_wait_time(&ctx, attr_data.clone()); + let attr_write_result = ::set_off_wait_time( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -1631,8 +1818,12 @@ mod tests { AttributeId::StartUpOnOff => { let attr_data: rs_matter_crate::tlv::Nullable = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; - let attr_write_result = - self.0.set_start_up_on_off(&ctx, attr_data.clone()); + let attr_write_result = ::set_start_up_on_off( + &self.0, + &ctx, + attr_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -1677,14 +1868,15 @@ mod tests { Ok(()) } #[allow(unreachable_code)] - fn invoke( + async fn invoke( &self, ctx: impl rs_matter_crate::dm::InvokeContext, reply: impl rs_matter_crate::dm::InvokeReply, ) -> Result<(), rs_matter_crate::error::Error> { match CommandId::try_from(ctx.cmd().cmd_id)? { CommandId::Off => { - let cmd_invoke_result = self.0.handle_off(&ctx); + let cmd_invoke_result = + ::handle_off(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1708,7 +1900,8 @@ mod tests { cmd_invoke_result?; } CommandId::On => { - let cmd_invoke_result = self.0.handle_on(&ctx); + let cmd_invoke_result = + ::handle_on(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1732,7 +1925,8 @@ mod tests { cmd_invoke_result?; } CommandId::Toggle => { - let cmd_invoke_result = self.0.handle_toggle(&ctx); + let cmd_invoke_result = + ::handle_toggle(&self.0, &ctx).await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1759,7 +1953,12 @@ mod tests { let cmd_data: OffWithEffectRequest<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; let cmd_invoke_result = - self.0.handle_off_with_effect(&ctx, cmd_data.clone()); + ::handle_off_with_effect( + &self.0, + &ctx, + cmd_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -1786,7 +1985,10 @@ mod tests { } CommandId::OnWithRecallGlobalScene => { let cmd_invoke_result = - self.0.handle_on_with_recall_global_scene(&ctx); + ::handle_on_with_recall_global_scene( + &self.0, &ctx, + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?} -> {:?}", @@ -1813,7 +2015,12 @@ mod tests { let cmd_data: OnWithTimedOffRequest<'_> = rs_matter_crate::tlv::FromTLV::from_tlv(ctx.data())?; let cmd_invoke_result = - self.0.handle_on_with_timed_off(&ctx, cmd_data.clone()); + ::handle_on_with_timed_off( + &self.0, + &ctx, + cmd_data.clone(), + ) + .await; #[cfg(feature = "defmt")] rs_matter_crate::reexport::defmt::debug!( "{:?}({:?}) -> {:?}", @@ -1857,6 +2064,13 @@ mod tests { self.0.dataver_changed(); Ok(()) } + fn run( + &self, + ctx: impl rs_matter_crate::dm::HandlerContext, + ) -> impl core::future::Future> + { + self.0.run(ctx) + } } impl core::fmt::Debug for MetadataDebug<(u16, &HandlerAdaptor, Q)> where @@ -1890,7 +2104,6 @@ mod tests { ) } } - impl rs_matter_crate::dm::NonBlockingHandler for HandlerAdaptor where T: ClusterHandler {} ) ); } diff --git a/rs-matter/src/dm/clusters/acl.rs b/rs-matter/src/dm/clusters/acl.rs index 6c7b77815..dec533b9d 100644 --- a/rs-matter/src/dm/clusters/acl.rs +++ b/rs-matter/src/dm/clusters/acl.rs @@ -149,7 +149,9 @@ impl ClusterHandler for AclHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for AclHandler { fn acl( &self, ctx: impl ReadContext, diff --git a/rs-matter/src/dm/clusters/adm_comm.rs b/rs-matter/src/dm/clusters/adm_comm.rs index e39a8a95e..6d35ac51f 100644 --- a/rs-matter/src/dm/clusters/adm_comm.rs +++ b/rs-matter/src/dm/clusters/adm_comm.rs @@ -71,7 +71,9 @@ impl ClusterHandler for AdminCommHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for AdminCommHandler { fn window_status(&self, ctx: impl ReadContext) -> Result { let matter = ctx.exchange().matter(); let mut pase_mgr = matter.pase_mgr.borrow_mut(); diff --git a/rs-matter/src/dm/clusters/basic_info.rs b/rs-matter/src/dm/clusters/basic_info.rs index 8d0dc6d63..db065fe43 100644 --- a/rs-matter/src/dm/clusters/basic_info.rs +++ b/rs-matter/src/dm/clusters/basic_info.rs @@ -419,7 +419,9 @@ impl ClusterHandler for BasicInfoHandler { fn dataver_changed(&self) { self.0.changed(); } +} +impl ClusterSyncHandler for BasicInfoHandler { fn data_model_revision(&self, ctx: impl ReadContext) -> Result { Ok(Self::config(ctx.exchange()).data_model_revision) } diff --git a/rs-matter/src/dm/clusters/desc.rs b/rs-matter/src/dm/clusters/desc.rs index 401ebd9db..4bbc8e5c8 100644 --- a/rs-matter/src/dm/clusters/desc.rs +++ b/rs-matter/src/dm/clusters/desc.rs @@ -138,7 +138,9 @@ impl ClusterHandler for DescHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for DescHandler<'_> { fn device_type_list( &self, ctx: impl ReadContext, diff --git a/rs-matter/src/dm/clusters/eth_diag.rs b/rs-matter/src/dm/clusters/eth_diag.rs index 222061cef..0245aadf8 100644 --- a/rs-matter/src/dm/clusters/eth_diag.rs +++ b/rs-matter/src/dm/clusters/eth_diag.rs @@ -52,7 +52,9 @@ impl ClusterHandler for EthDiagHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for EthDiagHandler { fn handle_reset_counts(&self, _ctx: impl InvokeContext) -> Result<(), Error> { Err(ErrorCode::InvalidAction.into()) } diff --git a/rs-matter/src/dm/clusters/gen_comm.rs b/rs-matter/src/dm/clusters/gen_comm.rs index de817585d..6cbf2a2c3 100644 --- a/rs-matter/src/dm/clusters/gen_comm.rs +++ b/rs-matter/src/dm/clusters/gen_comm.rs @@ -144,7 +144,9 @@ impl ClusterHandler for GenCommHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for GenCommHandler<'_> { fn breadcrumb(&self, ctx: impl ReadContext) -> Result { Ok(ctx.exchange().matter().failsafe.borrow_mut().breadcrumb()) } diff --git a/rs-matter/src/dm/clusters/gen_diag.rs b/rs-matter/src/dm/clusters/gen_diag.rs index 7f14e1e14..f19c91acc 100644 --- a/rs-matter/src/dm/clusters/gen_diag.rs +++ b/rs-matter/src/dm/clusters/gen_diag.rs @@ -208,7 +208,9 @@ impl ClusterHandler for GenDiagHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for GenDiagHandler<'_> { fn network_interfaces( &self, _ctx: impl ReadContext, diff --git a/rs-matter/src/dm/clusters/grp_key_mgmt.rs b/rs-matter/src/dm/clusters/grp_key_mgmt.rs index 27e609289..3f5a8c0df 100644 --- a/rs-matter/src/dm/clusters/grp_key_mgmt.rs +++ b/rs-matter/src/dm/clusters/grp_key_mgmt.rs @@ -57,7 +57,9 @@ impl ClusterHandler for GrpKeyMgmtHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for GrpKeyMgmtHandler { fn group_key_map( &self, _ctx: impl ReadContext, diff --git a/rs-matter/src/dm/clusters/level_control.rs b/rs-matter/src/dm/clusters/level_control.rs index 1fc11bfca..81c856610 100644 --- a/rs-matter/src/dm/clusters/level_control.rs +++ b/rs-matter/src/dm/clusters/level_control.rs @@ -358,8 +358,8 @@ impl<'a, H: LevelControlHooks, OH: OnOffHooks> LevelControlHandler<'a, H, OH> { } /// Adapt the handler instance to the generic `rs-matter` `Handler` trait - pub const fn adapt(self) -> HandlerAsyncAdaptor { - HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> HandlerAdaptor { + HandlerAdaptor(self) } // Helper accessors for `Nullable` attributes. @@ -1210,7 +1210,7 @@ impl<'a, H: LevelControlHooks, OH: OnOffHooks> LevelControlHandler<'a, H, OH> { } } -impl ClusterAsyncHandler for LevelControlHandler<'_, H, OH> { +impl ClusterHandler for LevelControlHandler<'_, H, OH> { const CLUSTER: Cluster<'static> = H::CLUSTER; // Runs an async task manager for the cluster handler. @@ -1251,19 +1251,21 @@ impl ClusterAsyncHandler for LevelControlH fn dataver_changed(&self) { self.dataver.changed(); } +} - async fn current_level(&self, _ctx: impl ReadContext) -> Result, Error> { +impl ClusterSyncHandler for LevelControlHandler<'_, H, OH> { + fn current_level(&self, _ctx: impl ReadContext) -> Result, Error> { match self.hooks.current_level() { Some(level) => Ok(Nullable::some(level)), None => Ok(Nullable::none()), } } - async fn on_level(&self, _ctx: impl ReadContext) -> Result, Error> { + fn on_level(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(self.on_level()) } - async fn set_on_level(&self, ctx: impl WriteContext, value: Nullable) -> Result<(), Error> { + fn set_on_level(&self, ctx: impl WriteContext, value: Nullable) -> Result<(), Error> { if let Some(level) = value.clone().into_option() { if level > H::MAX_LEVEL || level < H::MIN_LEVEL { return Err(ErrorCode::ConstraintError.into()); @@ -1276,49 +1278,45 @@ impl ClusterAsyncHandler for LevelControlH Ok(()) } - async fn options(&self, _ctx: impl ReadContext) -> Result { + fn options(&self, _ctx: impl ReadContext) -> Result { Ok(self.options.get()) } - async fn set_options(&self, ctx: impl WriteContext, value: OptionsBitmap) -> Result<(), Error> { + fn set_options(&self, ctx: impl WriteContext, value: OptionsBitmap) -> Result<(), Error> { self.options.set(value); self.dataver_changed(); ctx.notify_changed(); Ok(()) } - async fn remaining_time(&self, _ctx: impl ReadContext) -> Result { + fn remaining_time(&self, _ctx: impl ReadContext) -> Result { Ok(self.remaining_time.get()) } - async fn max_level(&self, _ctx: impl ReadContext) -> Result { + fn max_level(&self, _ctx: impl ReadContext) -> Result { Ok(H::MAX_LEVEL) } - async fn min_level(&self, _ctx: impl ReadContext) -> Result { + fn min_level(&self, _ctx: impl ReadContext) -> Result { Ok(H::MIN_LEVEL) } - async fn on_off_transition_time(&self, _ctx: impl ReadContext) -> Result { + fn on_off_transition_time(&self, _ctx: impl ReadContext) -> Result { Ok(self.on_off_transition_time.get()) } - async fn set_on_off_transition_time( - &self, - ctx: impl WriteContext, - value: u16, - ) -> Result<(), Error> { + fn set_on_off_transition_time(&self, ctx: impl WriteContext, value: u16) -> Result<(), Error> { self.on_off_transition_time.set(value); self.dataver_changed(); ctx.notify_changed(); Ok(()) } - async fn on_transition_time(&self, _ctx: impl ReadContext) -> Result, Error> { + fn on_transition_time(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(self.on_transition_time()) } - async fn set_on_transition_time( + fn set_on_transition_time( &self, ctx: impl WriteContext, value: Nullable, @@ -1329,11 +1327,11 @@ impl ClusterAsyncHandler for LevelControlH Ok(()) } - async fn off_transition_time(&self, _ctx: impl ReadContext) -> Result, Error> { + fn off_transition_time(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(self.off_transition_time()) } - async fn set_off_transition_time( + fn set_off_transition_time( &self, ctx: impl WriteContext, value: Nullable, @@ -1344,11 +1342,11 @@ impl ClusterAsyncHandler for LevelControlH Ok(()) } - async fn default_move_rate(&self, _ctx: impl ReadContext) -> Result, Error> { + fn default_move_rate(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(self.default_move_rate()) } - async fn set_default_move_rate( + fn set_default_move_rate( &self, ctx: impl WriteContext, value: Nullable, @@ -1365,14 +1363,14 @@ impl ClusterAsyncHandler for LevelControlH Ok(()) } - async fn start_up_current_level(&self, _ctx: impl ReadContext) -> Result, Error> { + fn start_up_current_level(&self, _ctx: impl ReadContext) -> Result, Error> { match self.hooks.start_up_current_level()? { Some(val) => Ok(Nullable::some(val)), None => Ok(Nullable::none()), } } - async fn set_start_up_current_level( + fn set_start_up_current_level( &self, ctx: impl WriteContext, value: Nullable, @@ -1391,7 +1389,7 @@ impl ClusterAsyncHandler for LevelControlH Ok(()) } - async fn handle_move_to_level( + fn handle_move_to_level( &self, _ctx: impl InvokeContext, request: MoveToLevelRequest<'_>, @@ -1405,11 +1403,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_move( - &self, - _ctx: impl InvokeContext, - request: MoveRequest<'_>, - ) -> Result<(), Error> { + fn handle_move(&self, _ctx: impl InvokeContext, request: MoveRequest<'_>) -> Result<(), Error> { self.move_command( false, request.move_mode()?, @@ -1419,11 +1413,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_step( - &self, - _ctx: impl InvokeContext, - request: StepRequest<'_>, - ) -> Result<(), Error> { + fn handle_step(&self, _ctx: impl InvokeContext, request: StepRequest<'_>) -> Result<(), Error> { self.step( false, request.step_mode()?, @@ -1434,11 +1424,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_stop( - &self, - ctx: impl InvokeContext, - request: StopRequest<'_>, - ) -> Result<(), Error> { + fn handle_stop(&self, ctx: impl InvokeContext, request: StopRequest<'_>) -> Result<(), Error> { self.stop( &ctx, false, @@ -1447,7 +1433,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_move_to_level_with_on_off( + fn handle_move_to_level_with_on_off( &self, _ctx: impl InvokeContext, request: MoveToLevelWithOnOffRequest<'_>, @@ -1461,7 +1447,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_move_with_on_off( + fn handle_move_with_on_off( &self, _ctx: impl InvokeContext, request: MoveWithOnOffRequest<'_>, @@ -1475,7 +1461,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_step_with_on_off( + fn handle_step_with_on_off( &self, _ctx: impl InvokeContext, request: StepWithOnOffRequest<'_>, @@ -1490,7 +1476,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_stop_with_on_off( + fn handle_stop_with_on_off( &self, ctx: impl InvokeContext, request: StopWithOnOffRequest<'_>, @@ -1503,7 +1489,7 @@ impl ClusterAsyncHandler for LevelControlH ) } - async fn handle_move_to_closest_frequency( + fn handle_move_to_closest_frequency( &self, _ctx: impl InvokeContext, _request: MoveToClosestFrequencyRequest<'_>, diff --git a/rs-matter/src/dm/clusters/net_comm.rs b/rs-matter/src/dm/clusters/net_comm.rs index 06da60ef5..f34f7651c 100644 --- a/rs-matter/src/dm/clusters/net_comm.rs +++ b/rs-matter/src/dm/clusters/net_comm.rs @@ -673,12 +673,12 @@ impl<'a, T> NetCommHandler<'a, T> { } /// Adapt the handler instance to the generic `rs-matter` `AsyncHandler` trait - pub const fn adapt(self) -> HandlerAsyncAdaptor { - HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> HandlerAdaptor { + HandlerAdaptor(self) } } -impl ClusterAsyncHandler for NetCommHandler<'_, T> +impl ClusterHandler for NetCommHandler<'_, T> where T: NetCtl + NetCtlStatus, { @@ -692,18 +692,6 @@ where self.dataver.changed(); } - async fn max_networks(&self, _ctx: impl ReadContext) -> Result { - self.networks.max_networks() - } - - async fn connect_max_time_seconds(&self, _ctx: impl ReadContext) -> Result { - Ok(self.net_ctl.connect_max_time_seconds()) - } - - async fn scan_max_time_seconds(&self, _ctx: impl ReadContext) -> Result { - Ok(self.net_ctl.scan_max_time_seconds()) - } - async fn supported_wi_fi_bands( &self, _ctx: impl ReadContext, @@ -749,17 +737,6 @@ where } } - async fn supported_thread_features( - &self, - _ctx: impl ReadContext, - ) -> Result { - Ok(self.net_ctl.supported_thread_features()) - } - - async fn thread_version(&self, _ctx: impl ReadContext) -> Result { - Ok(self.net_ctl.thread_version()) - } - async fn networks( &self, _ctx: impl ReadContext, @@ -802,10 +779,6 @@ where } } - async fn interface_enabled(&self, _ctx: impl ReadContext) -> Result { - self.networks.enabled() - } - async fn last_networking_status( &self, _ctx: impl ReadContext, @@ -827,21 +800,6 @@ where }) } - async fn last_connect_error_value( - &self, - _ctx: impl ReadContext, - ) -> Result, Error> { - Ok(Nullable::new(self.net_ctl.last_connect_error_value()?)) - } - - async fn set_interface_enabled( - &self, - _ctx: impl WriteContext, - value: bool, - ) -> Result<(), Error> { - self.networks.set_enabled(value) - } - async fn handle_scan_networks( &self, _ctx: impl InvokeContext, @@ -1108,8 +1066,36 @@ where status.read_into(index, response) } +} - async fn handle_query_identity( +impl ClusterSyncHandler for NetCommHandler<'_, T> +where + T: NetCtl + NetCtlStatus, +{ + fn max_networks(&self, _ctx: impl ReadContext) -> Result { + self.networks.max_networks() + } + + fn connect_max_time_seconds(&self, _ctx: impl ReadContext) -> Result { + Ok(self.net_ctl.connect_max_time_seconds()) + } + + fn scan_max_time_seconds(&self, _ctx: impl ReadContext) -> Result { + Ok(self.net_ctl.scan_max_time_seconds()) + } + + fn supported_thread_features( + &self, + _ctx: impl ReadContext, + ) -> Result { + Ok(self.net_ctl.supported_thread_features()) + } + + fn thread_version(&self, _ctx: impl ReadContext) -> Result { + Ok(self.net_ctl.thread_version()) + } + + fn handle_query_identity( &self, _ctx: impl InvokeContext, _request: QueryIdentityRequest<'_>, @@ -1117,4 +1103,16 @@ where ) -> Result { Err(ErrorCode::InvalidAction.into()) } + + fn interface_enabled(&self, _ctx: impl ReadContext) -> Result { + self.networks.enabled() + } + + fn last_connect_error_value(&self, _ctx: impl ReadContext) -> Result, Error> { + Ok(Nullable::new(self.net_ctl.last_connect_error_value()?)) + } + + fn set_interface_enabled(&self, _ctx: impl WriteContext, value: bool) -> Result<(), Error> { + self.networks.set_enabled(value) + } } diff --git a/rs-matter/src/dm/clusters/noc.rs b/rs-matter/src/dm/clusters/noc.rs index b3ede503a..a8ca8aa5a 100644 --- a/rs-matter/src/dm/clusters/noc.rs +++ b/rs-matter/src/dm/clusters/noc.rs @@ -109,7 +109,9 @@ impl ClusterHandler for NocHandler { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for NocHandler { fn nocs( &self, ctx: impl ReadContext, diff --git a/rs-matter/src/dm/clusters/on_off.rs b/rs-matter/src/dm/clusters/on_off.rs index f0b1ceb17..f1d2f17b5 100644 --- a/rs-matter/src/dm/clusters/on_off.rs +++ b/rs-matter/src/dm/clusters/on_off.rs @@ -264,8 +264,8 @@ impl<'a, H: OnOffHooks, LH: LevelControlHooks> OnOffHandler<'a, H, LH> { } /// Adapt the handler instance to the generic `rs-matter` `Handler` trait - pub const fn adapt(self) -> HandlerAsyncAdaptor { - HandlerAsyncAdaptor(self) + pub const fn adapt(self) -> HandlerAdaptor { + HandlerAdaptor(self) } /// Request an out-of-band change to the OnOff state. @@ -637,7 +637,7 @@ impl<'a, H: OnOffHooks, LH: LevelControlHooks> OnOffHandler<'a, H, LH> { } } -impl ClusterAsyncHandler for OnOffHandler<'_, H, LH> { +impl ClusterHandler for OnOffHandler<'_, H, LH> { #[doc = "The cluster-metadata corresponding to this handler trait."] const CLUSTER: Cluster<'static> = H::CLUSTER; @@ -676,46 +676,45 @@ impl ClusterAsyncHandler for OnOffHandler< } } } +} +impl ClusterSyncHandler for OnOffHandler<'_, H, LH> { // Attribute accessors - async fn on_off(&self, _ctx: impl ReadContext) -> Result { + fn on_off(&self, _ctx: impl ReadContext) -> Result { Ok(self.hooks.on_off()) } - async fn global_scene_control(&self, _ctx: impl ReadContext) -> Result { + fn global_scene_control(&self, _ctx: impl ReadContext) -> Result { Ok(self.global_scene_control.get()) } - async fn on_time(&self, _ctx: impl ReadContext) -> Result { + fn on_time(&self, _ctx: impl ReadContext) -> Result { Ok(self.on_time.get()) } - async fn off_wait_time(&self, _ctx: impl ReadContext) -> Result { + fn off_wait_time(&self, _ctx: impl ReadContext) -> Result { Ok(self.off_wait_time.get()) } - async fn start_up_on_off( - &self, - _ctx: impl ReadContext, - ) -> Result, Error> { + fn start_up_on_off(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(self.hooks.start_up_on_off()) } - async fn set_on_time(&self, ctx: impl WriteContext, value: u16) -> Result<(), Error> { + fn set_on_time(&self, ctx: impl WriteContext, value: u16) -> Result<(), Error> { self.on_time.set(value); self.dataver_changed(); ctx.notify_changed(); Ok(()) } - async fn set_off_wait_time(&self, ctx: impl WriteContext, value: u16) -> Result<(), Error> { + fn set_off_wait_time(&self, ctx: impl WriteContext, value: u16) -> Result<(), Error> { self.off_wait_time.set(value); self.dataver_changed(); ctx.notify_changed(); Ok(()) } - async fn set_start_up_on_off( + fn set_start_up_on_off( &self, ctx: impl WriteContext, value: Nullable, @@ -727,25 +726,25 @@ impl ClusterAsyncHandler for OnOffHandler< } // Commands - async fn handle_off(&self, _ctx: impl InvokeContext) -> Result<(), Error> { + fn handle_off(&self, _ctx: impl InvokeContext) -> Result<(), Error> { self.state_change_signal.signal(OnOffCommand::Off); Ok(()) } - async fn handle_on(&self, _ctx: impl InvokeContext) -> Result<(), Error> { + fn handle_on(&self, _ctx: impl InvokeContext) -> Result<(), Error> { self.state_change_signal.signal(OnOffCommand::On); Ok(()) } - async fn handle_toggle(&self, _ctx: impl InvokeContext) -> Result<(), Error> { + fn handle_toggle(&self, _ctx: impl InvokeContext) -> Result<(), Error> { self.state_change_signal.signal(OnOffCommand::Toggle); Ok(()) } - async fn handle_off_with_effect( + fn handle_off_with_effect( &self, _ctx: impl InvokeContext, request: OffWithEffectRequest<'_>, @@ -786,10 +785,7 @@ impl ClusterAsyncHandler for OnOffHandler< Ok(()) } - async fn handle_on_with_recall_global_scene( - &self, - _ctx: impl InvokeContext, - ) -> Result<(), Error> { + fn handle_on_with_recall_global_scene(&self, _ctx: impl InvokeContext) -> Result<(), Error> { // 1.5.7.5.1. Effect on Receipt // On receipt of the OnWithRecallGlobalScene command, if the GlobalSceneControl attribute is equal // to TRUE, the server SHALL discard the command. @@ -809,7 +805,7 @@ impl ClusterAsyncHandler for OnOffHandler< Err(ErrorCode::CommandNotFound.into()) } - async fn handle_on_with_timed_off( + fn handle_on_with_timed_off( &self, ctx: impl InvokeContext, request: OnWithTimedOffRequest<'_>, diff --git a/rs-matter/src/dm/clusters/thread_diag.rs b/rs-matter/src/dm/clusters/thread_diag.rs index 07573a1c9..16892ec43 100644 --- a/rs-matter/src/dm/clusters/thread_diag.rs +++ b/rs-matter/src/dm/clusters/thread_diag.rs @@ -402,7 +402,9 @@ impl ClusterHandler for ThreadDiagHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for ThreadDiagHandler<'_> { fn channel(&self, _ctx: impl ReadContext) -> Result, Error> { Ok(Nullable::new(self.diag.channel()?)) } diff --git a/rs-matter/src/dm/clusters/unit_testing.rs b/rs-matter/src/dm/clusters/unit_testing.rs index 16817e109..73ec4addd 100644 --- a/rs-matter/src/dm/clusters/unit_testing.rs +++ b/rs-matter/src/dm/clusters/unit_testing.rs @@ -528,7 +528,9 @@ impl ClusterHandler for UnitTestingHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for UnitTestingHandler<'_> { fn boolean(&self, _ctx: impl ReadContext) -> Result { Ok(self.data.borrow().boolean) } diff --git a/rs-matter/src/dm/clusters/wifi_diag.rs b/rs-matter/src/dm/clusters/wifi_diag.rs index 156bf68dd..a05a66f92 100644 --- a/rs-matter/src/dm/clusters/wifi_diag.rs +++ b/rs-matter/src/dm/clusters/wifi_diag.rs @@ -127,7 +127,9 @@ impl ClusterHandler for WifiDiagHandler<'_> { fn dataver_changed(&self) { self.dataver.changed(); } +} +impl ClusterSyncHandler for WifiDiagHandler<'_> { fn bssid( &self, _ctx: impl ReadContext, diff --git a/rs-matter/src/dm/endpoints.rs b/rs-matter/src/dm/endpoints.rs index a08309897..0575b4345 100644 --- a/rs-matter/src/dm/endpoints.rs +++ b/rs-matter/src/dm/endpoints.rs @@ -27,13 +27,13 @@ use super::clusters::gen_comm::{self, ClusterHandler as _, CommPolicy, GenCommHa use super::clusters::gen_diag::{self, ClusterHandler as _, GenDiag, GenDiagHandler, NetifDiag}; use super::clusters::grp_key_mgmt::{self, ClusterHandler as _, GrpKeyMgmtHandler}; use super::clusters::net_comm::{ - self, ClusterAsyncHandler as _, NetCommHandler, NetCtl, NetCtlStatus, NetworkType, Networks, + self, ClusterHandler as _, NetCommHandler, NetCtl, NetCtlStatus, NetworkType, Networks, }; use super::clusters::noc::{self, ClusterHandler as _, NocHandler}; use super::clusters::thread_diag::{self, ClusterHandler as _, ThreadDiag, ThreadDiagHandler}; use super::clusters::wifi_diag::{self, ClusterHandler as _, WifiDiag, WifiDiagHandler}; use super::networks::eth::{EthNetCtl, EthNetwork}; -use super::types::{Async, ChainedHandler, Dataver, Endpoint, EndptId, EpClMatcher}; +use super::types::{ChainedHandler, Dataver, Endpoint, EndptId, EpClMatcher}; /// A utility function to create a root (Endpoint 0) object using the requested operational network type. pub const fn root_endpoint(net_type: NetworkType) -> Endpoint<'static> { @@ -47,43 +47,43 @@ pub const fn root_endpoint(net_type: NetworkType) -> Endpoint<'static> { /// A type alias for the handler chain returned by `with_eth()`. pub type EthHandler<'a, H> = NetHandler< 'a, - net_comm::HandlerAsyncAdaptor>, - Async>, + net_comm::HandlerAdaptor>, + eth_diag::HandlerAdaptor, H, >; /// A type alias for the handler chain returned by `with_wifi()`. pub type WifiHandler<'a, T, H> = NetHandler< 'a, - net_comm::HandlerAsyncAdaptor>, - Async>>, + net_comm::HandlerAdaptor>, + wifi_diag::HandlerAdaptor>, H, >; /// A type alias for the handler chain returned by `with_thread()`. pub type ThreadHandler<'a, T, H> = NetHandler< 'a, - net_comm::HandlerAsyncAdaptor>, - Async>>, + net_comm::HandlerAdaptor>, + thread_diag::HandlerAdaptor>, H, >; pub type NetHandler<'a, NETCOMM, NETDIAG, H> = handler_chain_type!( EpClMatcher => NETCOMM, EpClMatcher => NETDIAG, - EpClMatcher => Async>> + EpClMatcher => gen_diag::HandlerAdaptor> | H ); /// A type alias for the handler chain returned by `with_sys()`. pub type SysHandler<'a, H> = handler_chain_type!( - EpClMatcher => Async>>, - EpClMatcher => Async>, - EpClMatcher => Async>>, - EpClMatcher => Async>, - EpClMatcher => Async>, - EpClMatcher => Async>, - EpClMatcher => Async> + EpClMatcher => desc::HandlerAdaptor>, + EpClMatcher => basic_info::HandlerAdaptor, + EpClMatcher => gen_comm::HandlerAdaptor>, + EpClMatcher => adm_comm::HandlerAdaptor, + EpClMatcher => noc::HandlerAdaptor, + EpClMatcher => acl::HandlerAdaptor, + EpClMatcher => grp_key_mgmt::HandlerAdaptor | H ); @@ -114,12 +114,12 @@ pub fn with_eth<'a, H>( ChainedHandler::new( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(GenDiagHandler::CLUSTER.id)), - Async(GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt()), + GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt(), handler, ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(EthDiagHandler::CLUSTER.id)), - Async(EthDiagHandler::new(Dataver::new_rand(rand)).adapt()), + EthDiagHandler::new(Dataver::new_rand(rand)).adapt(), ) .chain( EpClMatcher::new( @@ -157,12 +157,12 @@ where { ChainedHandler::new( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(GenDiagHandler::CLUSTER.id)), - Async(GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt()), + GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt(), handler, ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(WifiDiagHandler::CLUSTER.id)), - Async(WifiDiagHandler::new(Dataver::new_rand(rand), net_ctl).adapt()), + WifiDiagHandler::new(Dataver::new_rand(rand), net_ctl).adapt(), ) .chain( EpClMatcher::new( @@ -199,12 +199,12 @@ where { ChainedHandler::new( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(GenDiagHandler::CLUSTER.id)), - Async(GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt()), + GenDiagHandler::new(Dataver::new_rand(rand), gen_diag, netif_diag).adapt(), handler, ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(ThreadDiagHandler::CLUSTER.id)), - Async(ThreadDiagHandler::new(Dataver::new_rand(rand), net_ctl).adapt()), + ThreadDiagHandler::new(Dataver::new_rand(rand), net_ctl).adapt(), ) .chain( EpClMatcher::new( @@ -229,31 +229,31 @@ where pub fn with_sys(comm_policy: &dyn CommPolicy, rand: Rand, handler: H) -> SysHandler<'_, H> { ChainedHandler::new( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(GrpKeyMgmtHandler::CLUSTER.id)), - Async(GrpKeyMgmtHandler::new(Dataver::new_rand(rand)).adapt()), + GrpKeyMgmtHandler::new(Dataver::new_rand(rand)).adapt(), handler, ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(AclHandler::CLUSTER.id)), - Async(AclHandler::new(Dataver::new_rand(rand)).adapt()), + AclHandler::new(Dataver::new_rand(rand)).adapt(), ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(NocHandler::CLUSTER.id)), - Async(NocHandler::new(Dataver::new_rand(rand)).adapt()), + NocHandler::new(Dataver::new_rand(rand)).adapt(), ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(AdminCommHandler::CLUSTER.id)), - Async(AdminCommHandler::new(Dataver::new_rand(rand)).adapt()), + AdminCommHandler::new(Dataver::new_rand(rand)).adapt(), ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(GenCommHandler::CLUSTER.id)), - Async(GenCommHandler::new(Dataver::new_rand(rand), comm_policy).adapt()), + GenCommHandler::new(Dataver::new_rand(rand), comm_policy).adapt(), ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(BasicInfoHandler::CLUSTER.id)), - Async(BasicInfoHandler::new(Dataver::new_rand(rand)).adapt()), + BasicInfoHandler::new(Dataver::new_rand(rand)).adapt(), ) .chain( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(DescHandler::CLUSTER.id)), - Async(DescHandler::new(Dataver::new_rand(rand)).adapt()), + DescHandler::new(Dataver::new_rand(rand)).adapt(), ) } diff --git a/rs-matter/src/dm/types/handler.rs b/rs-matter/src/dm/types/handler.rs index bd3c7554a..95500f114 100644 --- a/rs-matter/src/dm/types/handler.rs +++ b/rs-matter/src/dm/types/handler.rs @@ -18,13 +18,12 @@ use embassy_sync::blocking_mutex::raw::NoopRawMutex; use crate::dm::IMBuffer; -use crate::error::{Error, ErrorCode}; use crate::tlv::TLVElement; use crate::transport::exchange::Exchange; use crate::utils::storage::pooled::{BufferAccess, PooledBuffers}; use crate::Matter; -use super::{AttrDetails, AttrId, ClusterId, CmdDetails, EndptId, InvokeReply, ReadReply}; +use super::{AttrDetails, AttrId, ClusterId, CmdDetails, EndptId}; pub use asynch::*; @@ -623,86 +622,6 @@ where pub trait DataModelHandler: super::AsyncMetadata + AsyncHandler {} impl DataModelHandler for T where T: super::AsyncMetadata + AsyncHandler {} -/// A version of the `AsyncHandler` trait that never awaits any operation. -/// -/// Prefer this trait when implementing handlers that are known to be non-blocking and additionally, -/// mark those with `NonBlockingHandler`. -pub trait Handler { - /// Read from the requested attribute and encode the result using the provided reply type. - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error>; - - /// Write into the requested attribute using the provided data. - fn write(&self, _ctx: impl WriteContext) -> Result<(), Error> { - Err(ErrorCode::AttributeNotFound.into()) - } - - /// Invoke the requested command with the provided data and encode the result using the provided reply type. - fn invoke(&self, _ctx: impl InvokeContext, _reply: impl InvokeReply) -> Result<(), Error> { - Err(ErrorCode::CommandNotFound.into()) - } -} - -impl Handler for &T -where - T: Handler, -{ - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - (**self).read(ctx, reply) - } - - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - (**self).write(ctx) - } - - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { - (**self).invoke(ctx, reply) - } -} - -impl Handler for &mut T -where - T: Handler, -{ - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - (**self).read(ctx, reply) - } - - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - (**self).write(ctx) - } - - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { - (**self).invoke(ctx, reply) - } -} - -/// A marker trait that indicates that the handler is non-blocking. -// TODO: Re-assess the need for this trait. -pub trait NonBlockingHandler: Handler {} - -impl NonBlockingHandler for &T where T: NonBlockingHandler {} - -impl NonBlockingHandler for &mut T where T: NonBlockingHandler {} - -impl Handler for (M, H) -where - H: Handler, -{ - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - self.1.read(ctx, reply) - } - - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - self.1.write(ctx) - } - - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { - self.1.invoke(ctx, reply) - } -} - -impl NonBlockingHandler for (M, H) where H: NonBlockingHandler {} - /// A trait that defines a matcher for determining whether a handler - member of a handler-chain (`ChainedHandler`) /// should be invoked for a specific operation. pub trait Matcher { @@ -803,14 +722,6 @@ impl EmptyHandler { } } -impl Handler for EmptyHandler { - fn read(&self, _ctx: impl ReadContext, _reply: impl ReadReply) -> Result<(), Error> { - Err(ErrorCode::AttributeNotFound.into()) - } -} - -impl NonBlockingHandler for EmptyHandler {} - /// A handler that chains two handlers together in a composite handler. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] @@ -856,45 +767,6 @@ impl ChainedHandler { } } -impl Handler for ChainedHandler -where - M: Matcher, - H: Handler, - T: Handler, -{ - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - if self.matcher.matches(&ctx) { - self.handler.read(ctx, reply) - } else { - self.next.read(ctx, reply) - } - } - - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - if self.matcher.matches(&ctx) { - self.handler.write(ctx) - } else { - self.next.write(ctx) - } - } - - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { - if self.matcher.matches(&ctx) { - self.handler.invoke(ctx, reply) - } else { - self.next.invoke(ctx, reply) - } - } -} - -impl NonBlockingHandler for ChainedHandler -where - M: Matcher, - H: NonBlockingHandler, - T: NonBlockingHandler, -{ -} - /// A helper macro that makes it easier to specify the full type of a `ChainedHandler` instantiation, /// which can be quite annoying in the case of long chains of handlers. /// @@ -941,10 +813,7 @@ mod asynch { use crate::error::{Error, ErrorCode}; use crate::utils::select::Coalesce; - use super::{ - ChainedHandler, EmptyHandler, Handler, InvokeContext, NonBlockingHandler, ReadContext, - WriteContext, - }; + use super::{ChainedHandler, EmptyHandler, InvokeContext, ReadContext, WriteContext}; /// A handler for processing a single IM operation: /// read an attribute, write an attribute, or invoke a command. @@ -1148,39 +1017,6 @@ mod asynch { } } - impl AsyncHandler for Async - where - T: NonBlockingHandler, - { - fn read_awaits(&self, _ctx: impl ReadContext) -> bool { - false - } - - fn write_awaits(&self, _ctx: impl WriteContext) -> bool { - false - } - - fn invoke_awaits(&self, _ctx: impl InvokeContext) -> bool { - false - } - - async fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - Handler::read(&self.0, ctx, reply) - } - - async fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - Handler::write(&self.0, ctx) - } - - async fn invoke( - &self, - ctx: impl InvokeContext, - reply: impl InvokeReply, - ) -> Result<(), Error> { - Handler::invoke(&self.0, ctx, reply) - } - } - impl AsyncHandler for EmptyHandler { fn read_awaits(&self, _ctx: impl ReadContext) -> bool { false @@ -1268,30 +1104,4 @@ mod asynch { select(&mut handler, &mut next).coalesce().await } } - - /// An adaptor that adapts a `NonBlockingHandler` trait implementation to the `AsyncHandler` trait contract. - /// - /// The adaptor also implements `NonBlockingHandler` so that the adapted handler can be used in any context. - #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] - #[cfg_attr(feature = "defmt", derive(defmt::Format))] - pub struct Async(pub T); - - impl Handler for Async - where - T: Handler, - { - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { - self.0.read(ctx, reply) - } - - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { - self.0.write(ctx) - } - - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { - self.0.invoke(ctx, reply) - } - } - - impl NonBlockingHandler for Async where T: NonBlockingHandler {} } diff --git a/rs-matter/src/dm/types/metadata.rs b/rs-matter/src/dm/types/metadata.rs index 351d9ffa0..87fada507 100644 --- a/rs-matter/src/dm/types/metadata.rs +++ b/rs-matter/src/dm/types/metadata.rs @@ -19,8 +19,6 @@ use crate::dm::Node; pub use asynch::*; -use super::Async; - pub trait MetadataGuard { fn node(&self) -> Node<'_>; } @@ -116,26 +114,12 @@ where } } -impl Metadata for Async -where - T: Metadata, -{ - type MetadataGuard<'a> - = T::MetadataGuard<'a> - where - Self: 'a; - - fn lock(&self) -> Self::MetadataGuard<'_> { - self.0.lock() - } -} - mod asynch { use core::future::Future; - use crate::dm::{Async, Node}; + use crate::dm::Node; - use super::{Metadata, MetadataGuard}; + use super::MetadataGuard; pub trait AsyncMetadata { type MetadataGuard<'a>: MetadataGuard @@ -200,18 +184,4 @@ mod asynch { self.0.lock() } } - - impl AsyncMetadata for Async - where - T: Metadata, - { - type MetadataGuard<'a> - = T::MetadataGuard<'a> - where - Self: 'a; - - async fn lock(&self) -> Self::MetadataGuard<'_> { - self.0.lock() - } - } } diff --git a/rs-matter/tests/common/e2e/im/echo_cluster.rs b/rs-matter/tests/common/e2e/im/echo_cluster.rs index ff7ed9d10..c0a91428b 100644 --- a/rs-matter/tests/common/e2e/im/echo_cluster.rs +++ b/rs-matter/tests/common/e2e/im/echo_cluster.rs @@ -26,8 +26,8 @@ use rs_matter::utils::storage::Vec; use strum::{EnumDiscriminants, FromRepr}; use rs_matter::dm::{ - Access, ArrayAttributeWrite, Attribute, Cluster, Command, Dataver, Handler, InvokeContext, - InvokeReply, NonBlockingHandler, Quality, ReadContext, ReadReply, Reply, WriteContext, + Access, ArrayAttributeWrite, AsyncHandler, Attribute, Cluster, Command, Dataver, InvokeContext, + InvokeReply, Quality, ReadContext, ReadReply, Reply, WriteContext, }; use rs_matter::error::{Error, ErrorCode}; use rs_matter::tlv::{TLVArray, TLVElement, TLVTag, TLVWrite}; @@ -292,18 +292,16 @@ impl EchoHandler { } } -impl Handler for EchoHandler { - fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { +impl AsyncHandler for EchoHandler { + async fn read(&self, ctx: impl ReadContext, reply: impl ReadReply) -> Result<(), Error> { EchoHandler::read(self, ctx, reply) } - fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { + async fn write(&self, ctx: impl WriteContext) -> Result<(), Error> { EchoHandler::write(self, ctx) } - fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { + async fn invoke(&self, ctx: impl InvokeContext, reply: impl InvokeReply) -> Result<(), Error> { EchoHandler::invoke(self, ctx, reply) } } - -impl NonBlockingHandler for EchoHandler {} diff --git a/rs-matter/tests/common/e2e/im/handler.rs b/rs-matter/tests/common/e2e/im/handler.rs index 0c685b29e..4dc8e1aa9 100644 --- a/rs-matter/tests/common/e2e/im/handler.rs +++ b/rs-matter/tests/common/e2e/im/handler.rs @@ -18,14 +18,13 @@ use rs_matter::dm::clusters::desc::{self, ClusterHandler as _, DescHandler}; use rs_matter::dm::clusters::level_control::LevelControlHooks; use rs_matter::dm::clusters::on_off::{ - self, test::TestOnOffDeviceLogic, ClusterAsyncHandler as _, NoLevelControl, OnOffHandler, - OnOffHooks, + self, test::TestOnOffDeviceLogic, ClusterHandler as _, NoLevelControl, OnOffHandler, OnOffHooks, }; use rs_matter::dm::devices::{DEV_TYPE_ON_OFF_LIGHT, DEV_TYPE_ROOT_NODE}; use rs_matter::dm::endpoints::{with_eth, with_sys, EthHandler, SysHandler, ROOT_ENDPOINT_ID}; use rs_matter::dm::{ - Async, AsyncHandler, AsyncMetadata, ChainedHandler, Dataver, EmptyHandler, Endpoint, - EpClMatcher, InvokeContext, InvokeReply, Node, ReadContext, ReadReply, WriteContext, + AsyncHandler, AsyncMetadata, ChainedHandler, Dataver, EmptyHandler, Endpoint, EpClMatcher, + InvokeContext, InvokeReply, Node, ReadContext, ReadReply, WriteContext, }; use rs_matter::error::Error; use rs_matter::Matter; @@ -38,10 +37,10 @@ use super::echo_cluster::{self, EchoHandler}; /// A sample handler for E2E IM tests. pub struct E2eTestHandler<'a, OH: OnOffHooks, LH: LevelControlHooks>( handler_chain_type!( - EpClMatcher => on_off::HandlerAsyncAdaptor>, - EpClMatcher => Async, - EpClMatcher => Async>>, - EpClMatcher => Async + EpClMatcher => on_off::HandlerAdaptor>, + EpClMatcher => EchoHandler, + EpClMatcher => desc::HandlerAdaptor>, + EpClMatcher => EchoHandler | EthHandler<'a, SysHandler<'a, EmptyHandler>>), ); @@ -76,20 +75,20 @@ impl<'a, OH: OnOffHooks, LH: LevelControlHooks> E2eTestHandler<'a, OH, LH> { let handler = ChainedHandler::new( EpClMatcher::new(Some(ROOT_ENDPOINT_ID), Some(echo_cluster::ID)), - Async(EchoHandler::new(2, Dataver::new_rand(matter.rand()))), + EchoHandler::new(2, Dataver::new_rand(matter.rand())), handler, ) .chain( EpClMatcher::new(Some(1), Some(DescHandler::CLUSTER.id)), - Async(DescHandler::new(Dataver::new_rand(matter.rand())).adapt()), + DescHandler::new(Dataver::new_rand(matter.rand())).adapt(), ) .chain( EpClMatcher::new(Some(1), Some(echo_cluster::ID)), - Async(EchoHandler::new(3, Dataver::new_rand(matter.rand()))), + EchoHandler::new(3, Dataver::new_rand(matter.rand())), ) .chain( EpClMatcher::new(Some(1), Some(TestOnOffDeviceLogic::CLUSTER.id)), - on_off::HandlerAsyncAdaptor(on_off), + on_off::HandlerAdaptor(on_off), ); Self(handler) @@ -97,8 +96,8 @@ impl<'a, OH: OnOffHooks, LH: LevelControlHooks> E2eTestHandler<'a, OH, LH> { pub fn echo_cluster(&self, endpoint: u16) -> &EchoHandler { match endpoint { - 0 => &self.0.next.next.next.handler.0, - 1 => &self.0.next.handler.0, + 0 => &self.0.next.next.next.handler, + 1 => &self.0.next.handler, _ => panic!(), } } diff --git a/rs-matter/tests/data_model/attributes.rs b/rs-matter/tests/data_model/attributes.rs index db337d356..335ee9748 100644 --- a/rs-matter/tests/data_model/attributes.rs +++ b/rs-matter/tests/data_model/attributes.rs @@ -16,7 +16,7 @@ */ use rs_matter::dm::clusters::on_off::{ - self, test::TestOnOffDeviceLogic, ClusterAsyncHandler as _, NoLevelControl, + self, test::TestOnOffDeviceLogic, ClusterHandler as _, NoLevelControl, }; use rs_matter::dm::GlobalElements; use rs_matter::im::GenericPath; diff --git a/rs-matter/tests/data_model/commands.rs b/rs-matter/tests/data_model/commands.rs index c23a9c960..2acce56a0 100644 --- a/rs-matter/tests/data_model/commands.rs +++ b/rs-matter/tests/data_model/commands.rs @@ -16,7 +16,7 @@ */ use rs_matter::dm::clusters::on_off::{ - self, test::TestOnOffDeviceLogic, ClusterAsyncHandler as _, NoLevelControl, + self, test::TestOnOffDeviceLogic, ClusterHandler as _, NoLevelControl, }; use rs_matter::im::IMStatusCode; use rs_matter::im::{CmdPath, CmdStatus}; diff --git a/scripts/memory/gh_report.py b/scripts/memory/gh_report.py index 715a59ff2..202f81f9e 100644 --- a/scripts/memory/gh_report.py +++ b/scripts/memory/gh_report.py @@ -140,7 +140,7 @@ def add_sizes_from_github(self): # Determine required size artifacts. artifact_limit = self.config['github.limit-artifacts'] - required_artifact_ids: set[int] = set() + required_artifacts: Dict[int, str] = {} for group, group_reports in size_artifacts.items(): logging.debug('ASG: group %s', group) for report in group_reports.values(): @@ -149,25 +149,26 @@ def add_sizes_from_github(self): logging.debug('ASN: No match for %s', report.name) continue if (artifact_limit - and len(required_artifact_ids) >= artifact_limit): + and len(required_artifacts) >= artifact_limit): continue # We have size information for both this report and its # parent, so ensure that both artifacts are downloaded. parent = group_reports[report.parent] - required_artifact_ids.add(report.id) - required_artifact_ids.add(parent.id) + required_artifacts[report.id] = f"{parent.pr}: {parent.name}" + required_artifacts[parent.id] = f"{parent.pr}: {parent.name}" logging.debug('ASM: Match %s', report.parent) logging.debug('ASR: %s %s', report.id, report.name) logging.debug('ASP: %s %s', parent.id, parent.name) # Download and add required artifacts. - for i in required_artifact_ids: + for i, name in required_artifacts.items(): blob = self.gh.download_artifact(i) if blob: try: self.db.add_sizes_from_zipfile(io.BytesIO(blob), {'artifact': i}) except Exception: + logging.error('Failed to process file: %s', name) # Report in case the zipfile is invalid, however do not fail # all the rest (behave as if artifact download has failed) traceback.print_exc()