Skip to main content

DynamicRpcValue

Struct DynamicRpcValue 

Source
pub struct DynamicRpcValue {
    pub ast: Arc<Ast>,
    pub type_name: String,
    pub data: DynamicData,
    pub dialect: Dialect,
}
Expand description

A DDS-RPC request/reply value: a DynamicData plus the Ast (and qualified type name) it was built or decoded against, so Self::encode and crate::dynxml can convert it without needing any other context.

Fields§

§ast: Arc<Ast>

The model this value’s fields are described against.

§type_name: String

The value’s qualified type name within ast.

§data: DynamicData

The value itself.

§dialect: Dialect

The CDR dialect it is encoded in; the specification’s unless Self::in_dialect names another.

Implementations§

Source§

impl DynamicRpcValue

Source

pub fn new(ast: Arc<Ast>, type_name: String, data: DynamicData) -> Self

Constructor.

Source

pub fn in_dialect(self, dialect: Dialect) -> Self

The same value, encoded in dialect — the participant’s wire.codec_dialect.

Trait Implementations§

Source§

impl Clone for DynamicRpcValue

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 DdsType for DynamicRpcValue

Source§

fn encode_be(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>

The reflective codec writes big-endian as readily as little-endian, so this answers instead of taking the trait’s refusal.

Source§

fn encode_continuing( &self, prefix: &mut Vec<u8>, xcdr1: bool, ) -> Result<(), EncodeError>

The value behind the first octets of a DDS-RPC sample, alignment counted from the sample (DDS-RPC 1.0 §7.5.1.1.6).

Source§

const TYPE_NAME: &'static str = "zerodds::webdds_bridge::DynamicRpcValue (requires crate::dynamic_rpc's decode context)"

Fully-qualified topic type name (e.g. "std_msgs::String"). Must match the peer type name exactly (strict matching).
Source§

fn encode(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>

Serializes self into the XCDR2 payload sent as the serialized_payload of a DATA submessage. Default endianness: little-endian (RTPS 2.5 §10.5 RepresentationIdentifier = CDR2_LE = 0x0010). Read more
Source§

fn decode(bytes: &[u8]) -> Result<Self, DecodeError>

Deserializes a little-endian XCDR2 payload. The caller ensures that bytes contains the full sample payload (encapsulation header already stripped). Read more
Source§

fn decode_be(bytes: &[u8]) -> Result<Self, DecodeError>

Big-endian variant of Self::decode — for a payload whose encapsulation header declared a big-endian representation identifier (CDR_BE = 0x0000, PL_CDR_BE = 0x0002, CDR2_BE = 0x0006, D_CDR2_BE = 0x0008, PL_CDR2_BE = 0x000a). Symmetric to Self::encode_be: the default reads through Self::decode only when Self::BYTE_ORDER_AGNOSTIC is asserted, because otherwise every multi-octet field would come back byte-swapped without an error. Spec: zerodds-xcdr2-rust §2.4; RTPS 2.5 §10.5. Read more
Source§

fn encode_xcdr1(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>

Serializes as classic CDR / XCDR1 little-endian (representation CDR_LE = 0x0001, max-alignment 8, no DHEADER on @final/@appendable, PL_CDR1 for @mutable). This is the encoding Cyclone DDS carries in an iceoryx PSMX chunk for a serialized sample, so the iceoryx-cyclone bridge uses it for cross-vendor same-host interop; it is also what a writer emits whenever the effective DataRepresentation offer starts with XCDR1 (the DDS/XTypes default, data_representation::XCDR). Read more
Source§

fn decode_xcdr1(bytes: &[u8]) -> Result<Self, DecodeError>

Deserializes a classic-CDR / XCDR1 little-endian payload. Symmetric to Self::encode_xcdr1: the default reaches Self::decode under the same Self::XCDR1_MATCHES_XCDR2 assertion — unchanged for @final, and for @appendable by putting the DHEADER back that XCDR1 does not carry — and otherwise refuses. A peer’s XCDR1 sample read through an XCDR2 decoder yields a sample the application cannot distinguish from a correct one. Read more
Source§

fn decode_continuing( bytes: &[u8], offset: usize, xcdr1: bool, ) -> Result<Self, DecodeError>

The counterpart of Self::encode_continuing: reads the value that begins at offset of bytes, alignment counted from the start of bytes. The default refuses an offset that is not a multiple of the alignment cap, for the reason given there. Read more
Source§

fn field_value(&self, path: &str) -> Option<FilterValue>

Returns the value of a field path (dotted, e.g. "a.b") as a zerodds_sql_filter::Value for SQL filter evaluation in QueryCondition / ContentFilteredTopic. Default: None (no field reachable — the filter then denies every sample that contains a field access). Read more
Source§

fn type_name() -> &'static str

The topic type name this endpoint announces. Read more
Source§

fn type_identifier() -> TypeIdentifier

The TypeIdentifier this endpoint announces in SEDP (PID_TYPE_INFORMATION, XTypes 1.3 §7.6.3.2). Defaults to Self::TYPE_IDENTIFIER. See Self::type_name for why this is a function.
Source§

fn extensibility() -> Extensibility

The extensibility this endpoint frames its samples with and declares in the encapsulation header (XTypes 1.3 §7.6.3.1.2). Defaults to Self::EXTENSIBILITY. See Self::type_name.
Source§

fn has_key() -> bool

Whether the topic type is keyed (XTypes 1.3 §7.6.8). Defaults to Self::HAS_KEY. See Self::type_name.
Source§

fn max_serialized_size() -> Option<usize>

Largest serialized sample of the type. Defaults to Self::MAX_SERIALIZED_SIZE.
Source§

fn key_holder_max_size() -> Option<usize>

Maximum size of the PLAIN_CDR2-BE KeyHolder stream (XTypes 1.3 §7.6.8.4 step 5). Defaults to Self::KEY_HOLDER_MAX_SIZE. See Self::type_name.
Source§

const EXTENSIBILITY: Extensibility = Extensibility::Final

XTypes 1.3 §7.4.5 struct extensibility kind. Default Final for backwards compat with pre-EXTENSIBILITY codegen outputs. Spec: zerodds-xcdr2-rust §2.3.
Source§

const XCDR1_MATCHES_XCDR2: bool = false

Asserts that this type’s member octets are framed the same way under XCDR1 (classic CDR) and XCDR2, so the Self::encode_xcdr1 / Self::decode_xcdr1 defaults may build the XCDR1 stream from the XCDR2 codec instead of refusing. Read more
Source§

fn xcdr1_delegation_is_sound() -> bool

Whether the Self::encode_xcdr1 / Self::decode_xcdr1 defaults may delegate to the XCDR2 codec unchanged. Read more
Source§

fn xcdr1_reframes_dheader() -> bool

Whether the XCDR1 defaults reach the XCDR2 codec by removing resp. adding the top-level DHEADER. Read more
Source§

const HAS_KEY: bool = false

true if the topic type is keyed (at least one member with a @key annotation). Default false — the caller (proc-macro) overrides this for keyed types and also implements Self::encode_key_holder_be. Read more
Source§

const IS_KEYED: bool = Self::HAS_KEY

Spec-aligned alias for Self::HAS_KEY. zerodds-xcdr2-rust §2 references this as IS_KEYED.
Source§

const KEY_HOLDER_MAX_SIZE: Option<usize> = None

Maximum size of the PLAIN_CDR2-BE KeyHolder stream in bytes (XTypes 1.3 §7.6.8.4 step 5). None = not keyed or unbounded (MD5 path). Some(n) with n <= 16 = zero-pad path.
Source§

const MAX_SERIALIZED_SIZE: Option<usize> = None

Largest serialized sample of the type, in octets, without the 4-octet encapsulation header; None for a type of unbounded or unknown size. A writer announces it, with the header added, as dataMaxSizeSerialized (DDSI-RTPS 2.5 Table 8.53, PID_TYPE_MAX_SIZE_SERIALIZED).
Source§

const IS_NESTED: bool = false

true if the type is annotated with @nested (XTypes 1.3 §7.4.6.3.5). Nested types are only intended as members of other types and MUST NOT be registered as a DDS topic type. DomainParticipant::create_topic rejects registration of nested types with PreconditionNotMet.
Source§

const TYPE_IDENTIFIER: TypeIdentifier = zerodds_types::TypeIdentifier::None

XTypes 1.3 §7.3.4.2 — TypeIdentifier of the type for XTypes-aware discovery + compatibility matching. Default TypeIdentifier::None signals “type-id not provided; reader-writer matching falls back to plain type_name comparison (DDS 1.4 §2.2.3 default path)”. Read more
Source§

fn type_object() -> Option<TypeObject>

XTypes 1.3 §7.3.4 — the full TypeObject for this type, if the codegen (or a hand impl) can provide it. Gap 2 (#24) auto-registration hook: Publisher::create_datawriter / Subscriber::create_datareader register the returned object with the runtime’s TypeLookup server (DcpsRuntime::register_type_object) at endpoint creation, so Read more
Source§

fn type_object_dependencies() -> Vec<TypeObject>

The TypeObjects that Self::type_object names by hash, transitively: a structure’s base type, the aggregate, enumeration, bitmask, union and alias types its members reach. Registered beside the type’s own object at endpoint creation, for the same two reasons (XTypes 1.3 §7.3.4.6, §7.6.3.3.4): a peer’s getTypeDependencies has to be answerable, and the local match site has to be able to resolve this endpoint’s own closure. An object registered without its closure resolves to nothing, and the runtime then cannot decide §7.6.3.4.2 for it at all. Read more
Source§

fn type_component() -> Option<TypeComponent>

The strongly connected component this type belongs to, in both forms, when Self::TYPE_IDENTIFIER is a TI_STRONGLY_CONNECTED_COMPONENT identifier (XTypes 1.3 §7.3.4.9). Read more
Source§

const BYTE_ORDER_AGNOSTIC: bool = false

Whether this type’s little-endian stream is also its big-endian one: a stream that holds no multi-octet value of the type’s own, such as opaque bytes the application serialized itself. Read more
Source§

fn encode_xcdr1_be(&self, _out: &mut Vec<u8>) -> Result<(), EncodeError>

Serializes as classic CDR / XCDR1 big-endian (CDR_BE = 0x0000 / PL_CDR_BE = 0x0002). Symmetric to Self::decode_xcdr1_be. There is no safe generic default (a BE re-encode needs per-member byte swapping), so the default errors explicitly rather than silently shipping little-endian or XCDR2 bytes under a big-endian XCDR1 encapsulation — which a strict peer would mis-decode. Types that go on the wire as big-endian XCDR1 (idl-rust codegen, ShapeType) override this. Read more
Source§

fn decode_xcdr1_be(_bytes: &[u8]) -> Result<Self, DecodeError>

Deserializes a classic-CDR / XCDR1 big-endian payload (encapsulation CDR_BE = 0x0000 / PL_CDR_BE = 0x0002). Symmetric to Self::encode_xcdr1_be, and refusing for the same reason: a generic big-endian read needs per-member byte swapping, so delegating to the little-endian reader would hand the application byte-swapped field values without an error. Types that receive big-endian XCDR1 (idl-rust codegen, ShapeType) override this. Read more
Source§

fn encode_key_holder_be(&self, _holder: &mut PlainCdr2BeKeyHolder)

Serializes the @key member values in PLAIN_CDR2-BE format into the given PlainCdr2BeKeyHolder. Order: ascending by member_id (XTypes 1.3 §7.6.8.3.1.b). Read more
Source§

fn decode_key_holder_be(_bytes: &[u8]) -> Result<Self, DecodeError>

Deserializes a FooKeyHolder written by Self::encode_key_holder_be and returns an instance whose @key members carry those values. Read more
Source§

fn compute_key_hash(&self) -> Option<[u8; 16]>

Computes the 16-byte KeyHash of this instance per XTypes 1.3 §7.6.8.4. None if HAS_KEY = false. Read more
Source§

fn key_hash(&self) -> Option<[u8; 16]>

Spec-aligned alias for Self::compute_key_hash. zerodds-xcdr2-rust §2.5 uses the name key_hash; the implementation name keeps compute_key_hash for historical compat. Both return the same value.
Source§

impl Debug for DynamicRpcValue

Source§

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

Formats the value using the given formatter. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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

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.