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,
{ ... }
}
Expand description
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
Required methods
Provided methods
Implementations on Foreign Types
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.