Trait zbus::DBusError

source ·
pub trait DBusError {
    // Required methods
    fn create_reply(&self, msg: &Header<'_>) -> Result<Message>;
    fn name(&self) -> ErrorName<'_>;
    fn description(&self) -> Option<&str>;
Expand description

A trait that needs to be implemented by error types to be returned from D-Bus methods.

Typically, you’d use the crate::fdo::Error since that covers quite a lot of failures but occasionally you might find yourself needing to use a custom error type. You’ll need to implement this trait for your error type. The easiest way to achieve that is to make use of the DBusError macro.

Required Methods§


fn create_reply(&self, msg: &Header<'_>) -> Result<Message>

Generate an error reply message for the given method call.


fn name(&self) -> ErrorName<'_>


fn description(&self) -> Option<&str>