Skip to main content

DdsError

Enum DdsError 

Source
#[non_exhaustive]
pub enum DdsError {
Show 15 variants BadParameter { what: &'static str, }, PreconditionNotMet { reason: &'static str, }, WireError { message: String, }, InconsistentPolicy { what: &'static str, }, TransportError { label: &'static str, }, OutOfResources { what: &'static str, }, Timeout, Unsupported { feature: &'static str, }, NotAllowedBySecurity { what: &'static str, }, IllegalOperation { what: &'static str, }, ImmutablePolicy { policy: &'static str, }, AlreadyDeleted, NoData, Other { reason: &'static str, }, NotEnabled,
}
Expand description

Fehler aus DCPS-Operationen. Halbwegs analog zum Spec- ReturnCode_t-Enum; wir lassen allerdings RETCODE_OK weg (stattdessen Result::Ok) und mergen BAD_PARAMETER + PRECONDITION_NOT_MET wo die Unterscheidung nichts hilft.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BadParameter

Ungueltiger Parameter (z.B. leerer Topic-Name).

Fields

§what: &'static str

Welcher Parameter, kurz.

§

PreconditionNotMet

Operation paesst nicht zum Entity-Zustand (z.B. write auf einen DataWriter, dessen Participant beendet wurde).

Fields

§reason: &'static str

Kurze Beschreibung.

§

WireError

Unterliegende Wire/CDR-Operation ist gefehlschlagen.

Fields

§message: String

Nachricht, statisch oder dynamisch.

§

InconsistentPolicy

QoS-Policy-Set nicht konsistent. Beispiel: Reliability= Best-Effort + History=KeepAll ohne resource_limits — Spec §2.2.3 nennt einige inkompatible Kombinationen.

Fields

§what: &'static str

Welche Policy(s) kollidieren.

§

TransportError

Transport-Operation fehlgeschlagen.

Fields

§label: &'static str

Statisches Label des Fehlers.

§

OutOfResources

Resource-Limit erreicht (max_samples, max_instances, etc.).

Fields

§what: &'static str

Welches Limit.

§

Timeout

Timeout bei blockierender Operation (take_w_timeout, etc.).

§

Unsupported

Operation nicht implementiert in v1.2.

Fields

§feature: &'static str

Kurz-Beschreibung.

§

NotAllowedBySecurity

Operation durch Security-Policy untersagt — DDS-Security 1.2 §7.3.25, DCPS 1.4 §2.2.2.1.1 ReturnCode_t = NOT_ALLOWED_BY_SECURITY. Der Permissions-/Access-Plugin hat das Lesen/Schreiben auf einem geschuetzten Topic abgelehnt; der Caller darf nicht erfahren, welches Permissions-Detail die Ursache war (Information-Leak).

Fields

§what: &'static str

Kurze, sicherheits-unkritische Beschreibung.

§

IllegalOperation

IllegalOperation — die Operation passt strukturell nicht (z.B. write() auf einen DataReader). DCPS 1.4 §2.2.2.1.1 ReturnCode_t = ILLEGAL_OPERATION.

Fields

§what: &'static str

Was nicht geht.

§

ImmutablePolicy

ImmutablePolicy — set_qos auf eine post-enable immutable QoS- Policy. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = IMMUTABLE_POLICY.

Fields

§policy: &'static str

Welche Policy.

§

AlreadyDeleted

AlreadyDeleted — Operation auf einer geloeschten Entity. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = ALREADY_DELETED.

§

NoData

NoData — read/take ohne neue Samples. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = NO_DATA. Wird in der Praxis oft als leerer Sample-Vec zurueckgegeben statt als Error.

§

Other

Error — generischer, nicht-spezifischer Fehler. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = ERROR. Letzte Wahl wenn keine spezifischere Variante passt; vermeidet Information-Leak gegenueber dem Caller.

Fields

§reason: &'static str

Kurze Beschreibung.

§

NotEnabled

NotEnabled — Operation auf einer Entity, die noch nicht via enable() aktiviert wurde. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = NOT_ENABLED. §2.1.2 — Entities sind nach create_* disabled bis enable(); viele Ops MUESSEN dann NotEnabled liefern.

Implementations§

Source§

impl DdsError

Source

pub fn as_return_code(&self) -> i32

Mappt den Fehler auf den OMG ReturnCode_t-Integer-Wert (DCPS 1.4 §2.2.2.1.1). WireError und TransportError werden auf RETCODE_ERROR (1) abgebildet — das ist Spec-konform: beide sind unspezifizierte Implementations-Fehler.

Trait Implementations§

Source§

impl Clone for DdsError

Source§

fn clone(&self) -> DdsError

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 DdsError

Source§

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

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

impl Display for DdsError

Source§

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

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

impl Error for DdsError

Available on crate feature std only.
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 DdsError

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DdsError

Source§

impl StructuralPartialEq for DdsError

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

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.