pub struct SubscribeReqBuilder<P, const F: usize = 0> { /* private fields */ }Expand description
Streaming builder for a SubscribeRequestMessage. Type-state-tagged
so the compiler enforces in-order field writes; optional fields
are implicitly skipped by not calling their setter.
Field-state values (state after each named field has been written or implicitly skipped):
0: nothing written yet1: pastKeepSubs2: pastMinIntFloor3: pastMaxIntCeil4: pastAttributeRequests5: pastEventRequests6: pastEventFilters7: pastFabricFiltered(mandatory; no implicit-skip from states 3-6 toend()— caller must invokefabric_filtered)8: pastDataVersionFilters9: pastInteractionModelRevision(auto-injected at default valueIM_REVISIONbyend()if the optional setter wasn’t called)
Implementations§
Source§impl<P> SubscribeReqBuilder<P>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P>where
P: TLVBuilderParent,
Source§impl<P> SubscribeReqBuilder<P>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P>where
P: TLVBuilderParent,
Sourcepub fn keep_subs(self, value: bool) -> Result<SubscribeReqBuilder<P, 1>, Error>
pub fn keep_subs(self, value: bool) -> Result<SubscribeReqBuilder<P, 1>, Error>
Write the mandatory KeepSubs field. true (the typical
value) instructs the peer to keep any existing subscriptions
for this fabric+peer pair alongside the new one; false
terminates them before establishing this subscription.
Source§impl<P> SubscribeReqBuilder<P, 1>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 1>where
P: TLVBuilderParent,
Sourcepub fn min_int_floor(
self,
value: u16,
) -> Result<SubscribeReqBuilder<P, 2>, Error>
pub fn min_int_floor( self, value: u16, ) -> Result<SubscribeReqBuilder<P, 2>, Error>
Write the mandatory MinIntervalFloor field (seconds). The
minimum reporting interval the peer is allowed to use; the
server may pick any interval at or above this floor.
Source§impl<P> SubscribeReqBuilder<P, 2>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 2>where
P: TLVBuilderParent,
Sourcepub fn max_int_ceil(
self,
value: u16,
) -> Result<SubscribeReqBuilder<P, 3>, Error>
pub fn max_int_ceil( self, value: u16, ) -> Result<SubscribeReqBuilder<P, 3>, Error>
Write the mandatory MaxIntervalCeiling field (seconds). The
peer MUST report no less frequently than this even if nothing
has changed (heartbeat). The server may pick any interval at
or below this ceiling — see Matter Core spec.
Source§impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
Sourcepub fn attr_requests(
self,
) -> Result<AttrPathArrayBuilder<SubscribeReqBuilder<P, 4>>, Error>
pub fn attr_requests( self, ) -> Result<AttrPathArrayBuilder<SubscribeReqBuilder<P, 4>>, Error>
Open the optional AttributeRequests array. Each .push()
yields an [AttrPathBuilder]; close with .end() to advance
to the next message field.
Sourcepub fn attr_requests_from(
self,
paths: &[AttrPath],
) -> Result<SubscribeReqBuilder<P, 4>, Error>
pub fn attr_requests_from( self, paths: &[AttrPath], ) -> Result<SubscribeReqBuilder<P, 4>, Error>
Write AttributeRequests from a pre-built slice. Convenience
for callers that already have an &[AttrPath] on hand.
Source§impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
Sourcepub fn event_requests_from(
self,
paths: &[EventPath],
) -> Result<SubscribeReqBuilder<P, 5>, Error>
pub fn event_requests_from( self, paths: &[EventPath], ) -> Result<SubscribeReqBuilder<P, 5>, Error>
Write EventRequests from a pre-built slice, implicitly
skipping AttributeRequests.
Source§impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
Sourcepub fn event_requests_from(
self,
paths: &[EventPath],
) -> Result<SubscribeReqBuilder<P, 5>, Error>
pub fn event_requests_from( self, paths: &[EventPath], ) -> Result<SubscribeReqBuilder<P, 5>, Error>
Write EventRequests from a pre-built slice.
Source§impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
pub fn event_filters_from( self, filters: &[EventFilter], ) -> Result<SubscribeReqBuilder<P, 6>, Error>
Source§impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
pub fn event_filters_from( self, filters: &[EventFilter], ) -> Result<SubscribeReqBuilder<P, 6>, Error>
Source§impl<P> SubscribeReqBuilder<P, 5>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 5>where
P: TLVBuilderParent,
Sourcepub fn event_filters_from(
self,
filters: &[EventFilter],
) -> Result<SubscribeReqBuilder<P, 6>, Error>
pub fn event_filters_from( self, filters: &[EventFilter], ) -> Result<SubscribeReqBuilder<P, 6>, Error>
Write EventFilters from a pre-built slice.
Source§impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 3>where
P: TLVBuilderParent,
Sourcepub fn fabric_filtered(
self,
value: bool,
) -> Result<SubscribeReqBuilder<P, 7>, Error>
pub fn fabric_filtered( self, value: bool, ) -> Result<SubscribeReqBuilder<P, 7>, Error>
Write the mandatory FabricFiltered field, implicitly
skipping AttributeRequests, EventRequests, and
EventFilters.
Source§impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 4>where
P: TLVBuilderParent,
pub fn fabric_filtered( self, value: bool, ) -> Result<SubscribeReqBuilder<P, 7>, Error>
Source§impl<P> SubscribeReqBuilder<P, 5>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 5>where
P: TLVBuilderParent,
pub fn fabric_filtered( self, value: bool, ) -> Result<SubscribeReqBuilder<P, 7>, Error>
Source§impl<P> SubscribeReqBuilder<P, 6>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 6>where
P: TLVBuilderParent,
Sourcepub fn fabric_filtered(
self,
value: bool,
) -> Result<SubscribeReqBuilder<P, 7>, Error>
pub fn fabric_filtered( self, value: bool, ) -> Result<SubscribeReqBuilder<P, 7>, Error>
Write the mandatory FabricFiltered field. true (the
typical value) constrains the subscription to attribute /
event reports for the accessing fabric only.
Source§impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
Sourcepub fn dataver_filters_from(
self,
filters: &[DataVersionFilter],
) -> Result<SubscribeReqBuilder<P, 8>, Error>
pub fn dataver_filters_from( self, filters: &[DataVersionFilter], ) -> Result<SubscribeReqBuilder<P, 8>, Error>
Write DataVersionFilters from a pre-built slice. Used by
caching clients to skip attributes whose data version hasn’t
advanced since the last cached read.
Source§impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
Source§impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 7>where
P: TLVBuilderParent,
Sourcepub fn interaction_model_revision(
self,
value: u8,
) -> Result<SubscribeReqBuilder<P, 9>, Error>
pub fn interaction_model_revision( self, value: u8, ) -> Result<SubscribeReqBuilder<P, 9>, Error>
Write InteractionModelRevision, implicitly skipping
DataVersionFilters. This is a typestate skip-shim mirroring
the pattern PR #447 established for SuppressResponse /
TimedRequest on InvReqBuilder: callers who don’t populate
the optional preceding field can advance straight to setting
(or auto-injecting) InteractionModelRevision without an
explicit no-op transition.
Source§impl<P> SubscribeReqBuilder<P, 8>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 8>where
P: TLVBuilderParent,
Sourcepub fn interaction_model_revision(
self,
value: u8,
) -> Result<SubscribeReqBuilder<P, 9>, Error>
pub fn interaction_model_revision( self, value: u8, ) -> Result<SubscribeReqBuilder<P, 9>, 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> SubscribeReqBuilder<P, 9>where
P: TLVBuilderParent,
impl<P> SubscribeReqBuilder<P, 9>where
P: TLVBuilderParent,
Trait Implementations§
Source§impl<P> TLVBuilder<P> for SubscribeReqBuilder<P>where
P: TLVBuilderParent,
impl<P> TLVBuilder<P> for SubscribeReqBuilder<P>where
P: TLVBuilderParent,
Source§impl<P, const F: usize> TLVBuilderParent for SubscribeReqBuilder<P, F>where
P: TLVBuilderParent,
impl<P, const F: usize> TLVBuilderParent for SubscribeReqBuilder<P, F>where
P: TLVBuilderParent,
Source§type Write = <P as TLVBuilderParent>::Write
type Write = <P as TLVBuilderParent>::Write
Source§fn writer(
&mut self,
) -> &mut <SubscribeReqBuilder<P, F> as TLVBuilderParent>::Write
fn writer( &mut self, ) -> &mut <SubscribeReqBuilder<P, F> as TLVBuilderParent>::Write
Auto Trait Implementations§
impl<P, const F: usize> Freeze for SubscribeReqBuilder<P, F>where
P: Freeze,
impl<P, const F: usize> RefUnwindSafe for SubscribeReqBuilder<P, F>where
P: RefUnwindSafe,
impl<P, const F: usize> Send for SubscribeReqBuilder<P, F>where
P: Send,
impl<P, const F: usize> Sync for SubscribeReqBuilder<P, F>where
P: Sync,
impl<P, const F: usize> Unpin for SubscribeReqBuilder<P, F>where
P: Unpin,
impl<P, const F: usize> UnsafeUnpin for SubscribeReqBuilder<P, F>where
P: UnsafeUnpin,
impl<P, const F: usize> UnwindSafe for SubscribeReqBuilder<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