pub struct Target {
pub fabric_index: FabricIndex,
pub node: Option<NodeId>,
pub group: Option<GroupId>,
pub endpoint: Option<EndpointId>,
pub cluster: Option<ClusterId>,
}Expand description
One binding (§9.6.5.1’s TargetStruct).
Either unicast — a node and an endpoint — or groupcast — a group. Never both, and
never neither. cluster narrows whichever it is.
Fields§
§fabric_index: FabricIndexThe fabric this binding belongs to, and the only one that can see it.
node: Option<NodeId>Node [1] — “the remote target node ID. If the Endpoint field is present, this field
SHALL be present.”
group: Option<GroupId>Group [2] — “the target group ID that represents remote endpoints”.
endpoint: Option<EndpointId>Endpoint [3] — “the remote endpoint that the local endpoint is bound to”.
cluster: Option<ClusterId>Cluster [4] — optional, and narrows the target to one cluster on it.
Implementations§
Source§impl Target
impl Target
Sourcepub const fn unicast(
fabric_index: FabricIndex,
node: NodeId,
endpoint: EndpointId,
) -> Self
pub const fn unicast( fabric_index: FabricIndex, node: NodeId, endpoint: EndpointId, ) -> Self
A unicast binding to one endpoint on one node.
Sourcepub const fn groupcast(fabric_index: FabricIndex, group: GroupId) -> Self
pub const fn groupcast(fabric_index: FabricIndex, group: GroupId) -> Self
A groupcast binding to every endpoint in a group.
Sourcepub const fn with_cluster(self, cluster: ClusterId) -> Self
pub const fn with_cluster(self, cluster: ClusterId) -> Self
The same binding, narrowed to one cluster on the target.
Sourcepub const fn is_valid(&self) -> bool
pub const fn is_valid(&self) -> bool
§9.6.5.1’s conformance, as a predicate.
- A group and an endpoint are mutually exclusive (
Groupis!Endpoint, and the other way round): a binding is unicast or groupcast, not a contradiction. - An endpoint requires a node (“If the Endpoint field is present, this field SHALL be present”), because an endpoint number alone names nothing.
- Something must be named. An empty target is a relationship with nobody.
Sourcepub const fn is_groupcast(&self) -> bool
pub const fn is_groupcast(&self) -> bool
Whether this is a groupcast binding.