Skip to main content

ProbeError

Enum ProbeError 

Source
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.

Fields

§name: String

The scoped name asked for.

§

NoLayout

The layout could not be planned.

Fields

§detail: String

What the planner said.

§

Mismatch

The value at path is not what the type calls for.

Fields

§path: String

Where, as a dotted path from the sample’s root.

§expected: String

What the type wanted.

§found: String

What the value held.

§

Missing

A member the type declares has no value and is not optional.

Fields

§path: String

Where.

§

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

§path: String

Where, as a dotted path from the sample’s root.

§expected: String

What this type can hold.

§found: String

What arrived.

§

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

§path: String

Where.

§declared: Vec<String>

The keys the type does declare, so the typo is visible.

§

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

§path: String

Where.

§kind: &'static str

Which construct, and why this target has no form for it.

§

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.

Fields

§path: String

Where.

§kind: &'static str

What was measured, including the emitted line.

§

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.

Fields

§path: String

Where.

§kind: &'static str

The rule, with its clause.

§

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.

Fields

§path: String

Where.

§kind: &'static str

The construct’s name, as the model spells 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

§path: String

Where, as a dotted path from the sample’s root.

§limit: usize

The 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.

Fields

§type_name: String

The type asked about.

Trait Implementations§

Source§

impl Clone for ProbeError

Source§

fn clone(&self) -> ProbeError

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 ProbeError

Source§

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

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

impl Display for ProbeError

Source§

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

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

impl Eq for ProbeError

Source§

impl Error for ProbeError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for ProbeError

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProbeError

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.