pub struct InvReqBuilder<P, const F: usize = 0> { /* private fields */ }Expand description
Streaming builder for an InvokeRequestMessage. Type-state-tagged
so the compiler enforces in-order field writes.
All three top-level fields (SuppressResponse, TimedRequest,
InvokeRequests) are mandatory on the wire per Matter Core spec,
and the builder always emits all three. The two booleans
are optional at the API level though — skipping either setter
causes the builder to write the field with its default value
(false) before opening the next state. This matches the
write_builder ergonomics and keeps the common-case ceremony to
invoke_requests()? only. The CmdData entries inside the array
have an optional CommandRef, also implicitly skippable.
Field-state values:
0: nothing written yet1: pastSuppressResponse2: pastTimedRequest3: pastInvokeRequestsarray4: pastInteractionModelRevision(auto-injected at default valueIM_REVISIONbyend()if the optional setter wasn’t called)
Implementations§
Source§impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
Source§impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
Sourcepub fn suppress_response(
self,
value: bool,
) -> Result<InvReqBuilder<P, 1>, Error>
pub fn suppress_response( self, value: bool, ) -> Result<InvReqBuilder<P, 1>, Error>
Write the SuppressResponse field. Omitting this call is
equivalent to suppress_response(false) (i.e. the typical
case — most clients want a response); the builder emits the
default automatically when timed_request or
invoke_requests is called from state 0. Set to true only
for fire-and-forget commands.
Source§impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
Sourcepub fn timed_request(self, value: bool) -> Result<InvReqBuilder<P, 2>, Error>
pub fn timed_request(self, value: bool) -> Result<InvReqBuilder<P, 2>, Error>
Write the TimedRequest field, implicitly emitting
SuppressResponse(false) first (the common-case default).
Source§impl<P> InvReqBuilder<P, 1>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P, 1>where
P: TLVBuilderParent,
Sourcepub fn timed_request(self, value: bool) -> Result<InvReqBuilder<P, 2>, Error>
pub fn timed_request(self, value: bool) -> Result<InvReqBuilder<P, 2>, Error>
Write the TimedRequest field. Omitting this call is
equivalent to timed_request(false); the builder emits the
default automatically when invoke_requests is called from
state 1. Set to true only when the surrounding flow sent a
TimedRequest IM message first (some commands like ACL
writes require this).
Source§impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P>where
P: TLVBuilderParent,
Sourcepub fn invoke_requests(
self,
) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
pub fn invoke_requests( self, ) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
Open the InvokeRequests array, implicitly emitting
SuppressResponse(false) and TimedRequest(false) first.
Source§impl<P> InvReqBuilder<P, 1>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P, 1>where
P: TLVBuilderParent,
Sourcepub fn invoke_requests(
self,
) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
pub fn invoke_requests( self, ) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
Open the InvokeRequests array, implicitly emitting
TimedRequest(false) first.
Source§impl<P> InvReqBuilder<P, 2>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P, 2>where
P: TLVBuilderParent,
Sourcepub fn invoke_requests(
self,
) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
pub fn invoke_requests( self, ) -> Result<CmdDataArrayBuilder<InvReqBuilder<P, 3>>, Error>
Open the InvokeRequests array. Each .push() starts one
CmdDataBuilder; close with .end() to return to the
message builder.
Source§impl<P> InvReqBuilder<P, 3>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P, 3>where
P: TLVBuilderParent,
Sourcepub fn interaction_model_revision(
self,
value: u8,
) -> Result<InvReqBuilder<P, 4>, Error>
pub fn interaction_model_revision( self, value: u8, ) -> Result<InvReqBuilder<P, 4>, Error>
Write the mandatory-on-the-wire InteractionModelRevision
field (Matter Core: value is 13 since Matter
1.3, unchanged in 1.4 and 1.5). Optional at the API level —
omit and end() injects IM_REVISION automatically.
Sourcepub fn end(self) -> Result<P, Error>
pub fn end(self) -> Result<P, Error>
Close the message struct, auto-injecting
InteractionModelRevision at its default value
IM_REVISION. Returns the parent.
Source§impl<P> InvReqBuilder<P, 4>where
P: TLVBuilderParent,
impl<P> InvReqBuilder<P, 4>where
P: TLVBuilderParent,
Trait Implementations§
Source§impl<P> TLVBuilder<P> for InvReqBuilder<P>where
P: TLVBuilderParent,
impl<P> TLVBuilder<P> for InvReqBuilder<P>where
P: TLVBuilderParent,
Source§impl<P, const F: usize> TLVBuilderParent for InvReqBuilder<P, F>where
P: TLVBuilderParent,
impl<P, const F: usize> TLVBuilderParent for InvReqBuilder<P, F>where
P: TLVBuilderParent,
Source§type Write = <P as TLVBuilderParent>::Write
type Write = <P as TLVBuilderParent>::Write
Source§fn writer(&mut self) -> &mut <InvReqBuilder<P, F> as TLVBuilderParent>::Write
fn writer(&mut self) -> &mut <InvReqBuilder<P, F> as TLVBuilderParent>::Write
Auto Trait Implementations§
impl<P, const F: usize> Freeze for InvReqBuilder<P, F>where
P: Freeze,
impl<P, const F: usize> RefUnwindSafe for InvReqBuilder<P, F>where
P: RefUnwindSafe,
impl<P, const F: usize> Send for InvReqBuilder<P, F>where
P: Send,
impl<P, const F: usize> Sync for InvReqBuilder<P, F>where
P: Sync,
impl<P, const F: usize> Unpin for InvReqBuilder<P, F>where
P: Unpin,
impl<P, const F: usize> UnsafeUnpin for InvReqBuilder<P, F>where
P: UnsafeUnpin,
impl<P, const F: usize> UnwindSafe for InvReqBuilder<P, F>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more