pub struct Error { /* private fields */ }Expand description
An error raised while talking to the bus.
Implementations§
Source§impl Error
impl Error
Sourcepub fn remote(name: impl AsRef<str>, message: impl Display) -> Self
pub fn remote(name: impl AsRef<str>, message: impl Display) -> Self
Construct an error which is reported back to a caller as an error reply.
§Examples
use tokio_dbus_runtime::Error;
let error = Error::remote("com.example.Error.Busy", "Try again later");
assert_eq!(error.name(), Some("com.example.Error.Busy"));Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The D-Bus error name, if this error came from, or is destined for, an error reply.
A timeout raised by this end reports itself as
org.freedesktop.DBus.Error.NoReply, which is the name every
implementation uses for a call which was not answered.
Sourcepub fn is_remote(&self) -> bool
pub fn is_remote(&self) -> bool
Test if this error is an error reply from the remote end.
When this is false the error was raised locally, such as a transport
failure or a timeout, and retrying against the same peer is unlikely to
behave differently.
§Examples
use tokio_dbus_runtime::Error;
let error = Error::remote("com.example.Error.Busy", "Try again later");
assert!(error.is_remote());Sourcepub fn is_name_taken(&self) -> bool
pub fn is_name_taken(&self) -> bool
Test if this error was raised by Connection::acquire_name because
the name was already taken.
Sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Test if this error is a call which timed out.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 From<SignatureError> for Error
impl From<SignatureError> for Error
Source§fn from(error: SignatureError) -> Self
fn from(error: SignatureError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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