pub struct Binding {
pub local_endpoint: u16,
pub fab_idx: NonZero<u8>,
pub node: Option<u64>,
pub group: Option<u16>,
pub endpoint: Option<u16>,
pub cluster: Option<u32>,
}Expand description
One binding entry: the local endpoint it is attached to, the fabric it belongs to, and the destination it points at.
This is the single entry type used for storage, persistence, and the
application-facing read API (Bindings::get). Application code that acts
on the device’s bindings (e.g. a switch reading its binding list to decide
which node(s) to send a command to) receives it cloned, so the registry lock
is never held across the await of the subsequent remote invoke. It is small
but not trivially Copy, hence Clone.
local_endpoint is this device’s endpoint that hosts the binding — not
to be confused with the remote target’s endpoint. A unicast target has
both node and endpoint set (cluster optional); a groupcast target has
group set instead. The destination fields mirror the spec’s TargetStruct.
Wire layout follows the standard derive(FromTLV, ToTLV) shape — a TLV
struct with positional context-tagged fields. Option<T> fields are
omit-if-None. The encoding is decoupled from the wire-level TargetStruct
(which puts FabricIndex at ctx 254): we own the persisted layout and only
need it to be self-consistent.
Fields§
§local_endpoint: u16The local endpoint this binding is attached to.
fab_idx: NonZero<u8>The fabric this binding belongs to.
node: Option<u64>The remote node id (set for a unicast target).
group: Option<u16>The group id (set for a groupcast target).
endpoint: Option<u16>The remote endpoint (set for a unicast target).
cluster: Option<u32>The cluster to address (optional).
Trait Implementations§
Source§impl<'__from_tlv> FromTLV<'__from_tlv> for Binding
impl<'__from_tlv> FromTLV<'__from_tlv> for Binding
Source§fn from_tlv(element: &TLVElement<'__from_tlv>) -> Result<Binding, Error>
fn from_tlv(element: &TLVElement<'__from_tlv>) -> Result<Binding, Error>
Source§fn init_from_tlv(element: TLVElement<'__from_tlv>) -> impl Init<Binding, Error>
fn init_from_tlv(element: TLVElement<'__from_tlv>) -> impl Init<Binding, Error>
Source§fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
fn nullable_from_tlv(element: &TLVElement<'a>) -> Result<Self, Error>
Source§fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
fn init_nullable_from_tlv(element: TLVElement<'a>) -> impl Init<Self, Error>
Source§impl ToTLV for Binding
impl ToTLV for Binding
Source§fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
fn to_tlv<W>(&self, tag: &TLVTag, tw: W) -> Result<(), Error>where
W: TLVWrite,
Source§fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
fn tlv_iter(&self, tag: TLVTag) -> impl Iterator<Item = Result<TLV<'_>, Error>>
TLV instances by potentially borrowing
data from the type.Source§impl<'__from_tlv> TryFrom<&TLVElement<'__from_tlv>> for Binding
impl<'__from_tlv> TryFrom<&TLVElement<'__from_tlv>> for Binding
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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