Skip to main content

Target

Struct Target 

Source
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: FabricIndex

The 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

Source

pub const fn unicast( fabric_index: FabricIndex, node: NodeId, endpoint: EndpointId, ) -> Self

A unicast binding to one endpoint on one node.

Source

pub const fn groupcast(fabric_index: FabricIndex, group: GroupId) -> Self

A groupcast binding to every endpoint in a group.

Source

pub const fn with_cluster(self, cluster: ClusterId) -> Self

The same binding, narrowed to one cluster on the target.

Source

pub const fn is_valid(&self) -> bool

§9.6.5.1’s conformance, as a predicate.

  • A group and an endpoint are mutually exclusive (Group is !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.
Source

pub const fn is_groupcast(&self) -> bool

Whether this is a groupcast binding.

Trait Implementations§

Source§

impl Clone for Target

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Target

Source§

impl Debug for Target

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Target

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Target

Source§

impl PartialEq for Target

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Target

Auto Trait Implementations§

§

impl Forget for Target

§

impl Freeze for Target

§

impl Move for Target

§

impl RefUnwindSafe for Target

§

impl Send for Target

§

impl Sync for Target

§

impl Unpin for Target

§

impl UnsafeUnpin for Target

§

impl UnwindSafe for Target

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.