pub enum ProbeError {
NoSuchType {
name: String,
},
NoLayout {
detail: String,
},
Mismatch {
path: String,
expected: String,
found: String,
},
Missing {
path: String,
},
Discarded {
path: String,
expected: String,
found: String,
},
Unknown {
path: String,
declared: Vec<String>,
},
Unsupported {
path: String,
kind: &'static str,
},
GeneratorDefect {
path: String,
kind: &'static str,
},
MappingDivergence {
path: String,
kind: &'static str,
},
Unfilled {
path: String,
kind: &'static str,
},
ValueTooDeep {
path: String,
limit: usize,
},
NoKey {
type_name: String,
},
}Expand description
Why a probe could not produce bytes.
Every variant names where in the value the trouble is, because a probe that said only “type mismatch” over a fifty-member sample is a probe nobody uses twice.
Variants§
NoSuchType
The requested type is not in the model.
NoLayout
The layout could not be planned.
Mismatch
The value at path is not what the type calls for.
Fields
Missing
A member the type declares has no value and is not optional.
Discarded
The stream is a well-formed sample of a compatible type, and no object of this type can be constructed from it.
The try_construct outcome of DDS-XTypes 1.3 §7.2.2.7 —
a string<32> holding twelve characters arriving where the
receiver declares string<5>, a sequence<long,32> of eight
arriving at a bound of four, an enumerator this type does not
declare — where the governing behaviour is DISCARD.
§Why this is not one of the other variants
§7.2.4.1: “the default behavior is to discard the O2 object to
avoid misinterpretation”, and §7.2.3: the sample “can be safely
ignored (filtered out) by the receiver”. A discarded sample is an
absence, not an error: a DDS subscriber’s take() returns
nothing and no listener fires. Measured — in Cyclone the
normalize failure makes ddsi_serdata_from_ser return NULL,
remote_make_sample passes the NULL on and delivery ends at
remote_on_delivery_failure_fastpath, so the sample never
becomes one.
Self::Mismatch and the framing errors underneath it say the
stream is wrong and the peer needs fixing. This says one sample
does not fit a type that is otherwise perfectly compatible, and
the next sample may well fit. Keeping them apart is the whole
point: a subscriber that logged every narrowed sample as a
protocol error would drown, and one that treated a malformed
stream as a narrowing would never notice a broken peer.
Fields
Unknown
The value holds a key the type does not declare.
An error and not a warning: a misspelled member name would otherwise silently test the default value.
Fields
Unsupported
A construct this target has no form for.
kind carries the whole reason, in the target’s terms — “a
bitmask, which is XTypes 1.3 §7.3.1.2.1.4 and not CORBA IDL”,
“a map, which the IDL-to-C mapping §7.5.1 reuses does not
have”. The rendering used to append “is not serialised by this
probe yet” to every one of them, which turned a limit of CORBA
or of a vendor’s front end into a backlog item of ours. It was
read that way: a review of why nine toolchains produced nothing
for so many corpus cases classified all 127 of TAO’s as ours on
the strength of that suffix, when every one of them names a
construct CORBA IDL does not have.
Where the limit really is this probe’s, Self::Unfilled says
so in its own words.
Fields
GeneratorDefect
The target took the construct and its own generated code does not build.
A measurement of the toolchain and not of its specification,
which is why it is not Self::Unsupported: rosidl’s IDL
takes wchar[3] without a word, and what
rosidl_typesupport_fastrtps_c 2.2.2 emits calls an undeclared
callbacks. Recorded as a missing form, it said ROS has no
collection of wchar — the opposite of what was measured.
MappingDivergence
The target carries the construct and a documented mapping rule makes the octets differ.
Also a measurement, and also not a missing form. omniidl and
tao_idl both take long double; CORBA’s C++ mapping makes it
the platform’s x87 extended precision and not §9.3.1.3’s
binary128.
Unfilled
A construct this probe has not implemented.
Separate from Self::Unsupported, which is a limit of the
target. Twenty-one sites reach a catch-all arm and have only
the construct’s own name to give — union, map — and a bare
noun as a whole message says neither what is wrong nor whose
gap it is. This variant supplies the sentence around it.
ValueTooDeep
The value nests deeper than crate::MAX_VALUE_DEPTH
aggregates.
A recursive type has finite values because each one terminates
itself — a sequence of length zero, an absent @optional
member. A value whose object graph has a cycle, a.next = a,
terminates nowhere, and XTypes 1.3 §7.3.1.2.1.4 says of it “if
the graph of objects has cycles, it is not serializable”.
The walk cannot see the cycle — it is handed one member, or one header, at a time — so it counts, and says this. Not a silent truncation and not a stack overflow: the caller is told which value, how deep it went and what the limit is.
Fields
limit: usizeThe limit that was passed, crate::MAX_VALUE_DEPTH.
NoKey
A KeyHash was asked for on a type that declares no @key.
Not “unsupported” and not a zero hash: a keyless topic has one
instance, so there is no handle to compute, and Cyclone, RTI and
Fast DDS all decide that before any hash is. See key_hash.
Trait Implementations§
Source§impl Clone for ProbeError
impl Clone for ProbeError
Source§fn clone(&self) -> ProbeError
fn clone(&self) -> ProbeError
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 ProbeError
impl Debug for ProbeError
Source§impl Display for ProbeError
impl Display for ProbeError
impl Eq for ProbeError
Source§impl Error for ProbeError
impl Error for ProbeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()