Trait rustdds::dds::traits::Keyed[][src]

pub trait Keyed {
    type K;
    fn get_key(&self) -> Self::K;

    fn get_hash(&self) -> u64
    where
        Self::K: Key
, { ... } }

A sample data type may be Keyed : It allows a Key to be extracted from the sample. In its simplest form, the key may be just a part of the sample data, but it can be anything computable from a sample by an application-defined function.

The key is used to distinguish between different Instances of the data in a DDS Topic.

A Keyed type has an associated type K, which is the actual key type. K must implement Key. Otherwise, K can be chosen to suit the application. It is advisable that K is something that can be cloned with reasonable effort.

Associated Types

type K[src]

Loading content...

Required methods

fn get_key(&self) -> Self::K[src]

Loading content...

Provided methods

fn get_hash(&self) -> u64 where
    Self::K: Key
[src]

Loading content...

Implementations on Foreign Types

impl<D: Keyed> Keyed for &D[src]

Key for a reference type &D is the same as for the value type D. This is required internally for the implementation of NoKey topics.

type K = D::K

Loading content...

Implementors

impl Keyed for DiscoveredTopicData[src]

type K = GUID

Loading content...