Skip to main content

DataHolder

Struct DataHolder 

Source
pub struct DataHolder {
    pub class_id: String,
    pub properties: Vec<WireProperty>,
    pub binary_properties: Vec<BinaryProperty>,
}
Expand description

Spec §7.2.7 Tab.7 — generic DataHolder_t wire struct. All security tokens are type aliases of DataHolder with a fixed class_id value.

Fields§

§class_id: String

Plugin class id, e.g. "DDS:Auth:PKI-DH:1.2".

§properties: Vec<WireProperty>

String properties (spec §7.2.6 Tab.5).

§binary_properties: Vec<BinaryProperty>

Binary properties (spec §7.2.6 Tab.6).

Implementations§

Source§

impl DataHolder

Source

pub fn new(class_id: impl Into<String>) -> Self

Constructor with only class_id.

Source

pub fn with_property( self, name: impl Into<String>, value: impl Into<String>, ) -> Self

Builder: adds a string property.

Source

pub fn with_binary_property( self, name: impl Into<String>, value: impl Into<Vec<u8>>, ) -> Self

Builder: adds a binary property.

Source

pub fn set_property( &mut self, name: impl Into<String>, value: impl Into<String>, )

Mut variant: sets a string property with replace-on-dup semantics (if the name already exists, the old value is overwritten — spec §7.2.6: per token each property name may appear only once).

Source

pub fn set_binary_property( &mut self, name: impl Into<String>, value: impl Into<Vec<u8>>, )

Mut variant: sets a binary property with replace-on-dup.

Source

pub fn property(&self, name: &str) -> Option<&str>

Looks up a string property by name.

Source

pub fn binary_property(&self, name: &str) -> Option<&[u8]>

Looks up a binary property by name.

Source

pub fn to_cdr_le(&self) -> Vec<u8>

XCDR1 little-endian encoder. Returns the bytes without the encapsulation header — that is supplied by the caller (e.g. the ParameterList value).

Source

pub fn to_cdr_be(&self) -> Vec<u8>

XCDR1-Big-Endian-Encoder.

Source

pub fn from_cdr_le(bytes: &[u8]) -> SecurityResult<Self>

XCDR1-Decoder, Little-Endian.

§Errors

BadArgument if the bytes are not spec-conformant (e.g. premature end, overly long length prefixes).

Source

pub fn from_cdr_le_consumed(bytes: &[u8]) -> SecurityResult<(Self, usize)>

Like from_cdr_le, additionally returns the number of bytes consumed. For inline sequence<DataHolder> decoding (spec GenericMessageData), where multiple DataHolders lie one after another without a length prefix.

§Errors

BadArgument on non-spec-conformant bytes.

Source

pub fn from_cdr_be(bytes: &[u8]) -> SecurityResult<Self>

XCDR1-Decoder, Big-Endian.

§Errors

BadArgument if the bytes are not spec-conformant.

Source§

impl DataHolder

Source

pub fn pki_dh_v12( cert_sn: impl Into<String>, cert_algo: impl Into<String>, ca_sn: impl Into<String>, ca_algo: impl Into<String>, ) -> Self

Builtin helper for the PKI-DH IdentityToken (§10.3.2.1 Tab.51). Properties dds.cert.sn, dds.cert.algo, dds.ca.sn, dds.ca.algo. No binary_properties.

Source

pub fn permissions_v12( perm_ca_sn: impl Into<String>, perm_ca_algo: impl Into<String>, ) -> Self

Builtin helper for the permissions token (§10.4.2 Tab.65). class_id="DDS:Access:Permissions:1.2", properties dds.perm_ca.sn + dds.perm_ca.algo.

Trait Implementations§

Source§

impl Clone for DataHolder

Source§

fn clone(&self) -> DataHolder

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 Debug for DataHolder

Source§

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

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

impl Default for DataHolder

Source§

fn default() -> DataHolder

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

impl Eq for DataHolder

Source§

impl PartialEq for DataHolder

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for DataHolder

Auto Trait Implementations§

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.