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: StringThe value’s qualified type name within ast.
data: DynamicDataThe value itself.
dialect: DialectThe CDR dialect it is encoded in; the specification’s unless
Self::in_dialect names another.
Implementations§
Source§impl DynamicRpcValue
impl DynamicRpcValue
Sourcepub fn in_dialect(self, dialect: Dialect) -> Self
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
impl Clone for DynamicRpcValue
Source§impl DdsType for DynamicRpcValue
impl DdsType for DynamicRpcValue
Source§fn encode_be(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>
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>
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)"
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>
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 moreSource§fn decode(bytes: &[u8]) -> Result<Self, DecodeError>
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 moreSource§fn decode_be(bytes: &[u8]) -> Result<Self, DecodeError>
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 moreSource§fn encode_xcdr1(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>
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 moreSource§fn decode_xcdr1(bytes: &[u8]) -> Result<Self, DecodeError>
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 moreSource§fn decode_continuing(
bytes: &[u8],
offset: usize,
xcdr1: bool,
) -> Result<Self, DecodeError>
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 moreSource§fn field_value(&self, path: &str) -> Option<FilterValue>
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 moreSource§fn type_identifier() -> TypeIdentifier
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
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
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>
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>
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
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
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 moreSource§fn xcdr1_delegation_is_sound() -> bool
fn xcdr1_delegation_is_sound() -> bool
Whether the
Self::encode_xcdr1 / Self::decode_xcdr1 defaults may
delegate to the XCDR2 codec unchanged. Read moreSource§fn xcdr1_reframes_dheader() -> bool
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
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 moreSource§const KEY_HOLDER_MAX_SIZE: Option<usize> = None
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
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
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
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 moreSource§fn type_object() -> Option<TypeObject>
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 moreSource§fn type_object_dependencies() -> Vec<TypeObject>
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 moreSource§fn type_component() -> Option<TypeComponent>
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 moreSource§const BYTE_ORDER_AGNOSTIC: bool = false
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>
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 moreSource§fn decode_xcdr1_be(_bytes: &[u8]) -> Result<Self, DecodeError>
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 moreSource§fn encode_key_holder_be(&self, _holder: &mut PlainCdr2BeKeyHolder)
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 moreSource§fn decode_key_holder_be(_bytes: &[u8]) -> Result<Self, DecodeError>
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for DynamicRpcValue
impl !UnwindSafe for DynamicRpcValue
impl Freeze for DynamicRpcValue
impl Send for DynamicRpcValue
impl Sync for DynamicRpcValue
impl Unpin for DynamicRpcValue
impl UnsafeUnpin for DynamicRpcValue
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more