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: StringPlugin 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
impl DataHolder
Sourcepub fn with_property(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_property( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Builder: adds a string property.
Sourcepub fn with_binary_property(
self,
name: impl Into<String>,
value: impl Into<Vec<u8>>,
) -> Self
pub fn with_binary_property( self, name: impl Into<String>, value: impl Into<Vec<u8>>, ) -> Self
Builder: adds a binary property.
Sourcepub fn set_property(
&mut self,
name: impl Into<String>,
value: impl Into<String>,
)
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).
Sourcepub fn set_binary_property(
&mut self,
name: impl Into<String>,
value: impl Into<Vec<u8>>,
)
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.
Sourcepub fn binary_property(&self, name: &str) -> Option<&[u8]>
pub fn binary_property(&self, name: &str) -> Option<&[u8]>
Looks up a binary property by name.
Sourcepub fn to_cdr_le(&self) -> Vec<u8> ⓘ
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).
Sourcepub fn from_cdr_le(bytes: &[u8]) -> SecurityResult<Self>
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).
Sourcepub fn from_cdr_le_consumed(bytes: &[u8]) -> SecurityResult<(Self, usize)>
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.
Sourcepub fn from_cdr_be(bytes: &[u8]) -> SecurityResult<Self>
pub fn from_cdr_be(bytes: &[u8]) -> SecurityResult<Self>
Source§impl DataHolder
impl DataHolder
Trait Implementations§
Source§impl Clone for DataHolder
impl Clone for DataHolder
Source§fn clone(&self) -> DataHolder
fn clone(&self) -> DataHolder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataHolder
impl Debug for DataHolder
Source§impl Default for DataHolder
impl Default for DataHolder
Source§fn default() -> DataHolder
fn default() -> DataHolder
impl Eq for DataHolder
Source§impl PartialEq for DataHolder
impl PartialEq for DataHolder
Source§fn eq(&self, other: &DataHolder) -> bool
fn eq(&self, other: &DataHolder) -> bool
self and other values to be equal, and is used by ==.