pub enum RclrsError {
RclError {
code: RclReturnCode,
msg: Option<RclErrorMsg>,
},
UnknownRclError {
code: i32,
msg: Option<RclErrorMsg>,
},
StringContainsNul {
s: String,
err: NulError,
},
AlreadyAddedToWaitSet,
}
Expand description
The main error type.
Variants§
RclError
An error originating in the rcl
layer.
Fields
§
code: RclReturnCode
The error code.
§
msg: Option<RclErrorMsg>
The error message set in the rcl
layer or below.
UnknownRclError
An unknown error originating in the rcl
layer.
Fields
§
msg: Option<RclErrorMsg>
The error message set in the rcl
layer or below.
StringContainsNul
A string provided to rclrs
could not be converted into a CString
.
Fields
AlreadyAddedToWaitSet
It was attempted to add a waitable to a wait set twice.
Implementations§
Source§impl RclrsError
impl RclrsError
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if the error was due to a timeout, otherwise returns false.
Sourcepub fn is_take_failed(&self) -> bool
pub fn is_take_failed(&self) -> bool
Returns true if the error was because a subscription, service, or client take failed, otherwise returns false.
Trait Implementations§
Source§impl Debug for RclrsError
impl Debug for RclrsError
Source§impl Display for RclrsError
impl Display for RclrsError
Source§impl Error for RclrsError
impl Error for RclrsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for RclrsError
impl PartialEq for RclrsError
impl Eq for RclrsError
impl StructuralPartialEq for RclrsError
Auto Trait Implementations§
impl Freeze for RclrsError
impl RefUnwindSafe for RclrsError
impl Send for RclrsError
impl Sync for RclrsError
impl Unpin for RclrsError
impl UnwindSafe for RclrsError
Blanket Implementations§
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