pub trait MessageConversionExt<'a, B>: 'a + MessageConversion<'a, Body<'a> = B>{
// Required method
fn try_from_message(
msg: &'a Message,
hdr: &Header<'_>,
) -> Result<Self, AtspiError>
where Self: Sized + 'a;
// Provided methods
fn validate_interface(header: &Header<'_>) -> Result<(), AtspiError> { ... }
fn validate_member(hdr: &Header<'_>) -> Result<(), AtspiError> { ... }
fn validate_body(msg: &Message) -> Result<(), AtspiError> { ... }
}Required Methods§
Sourcefn try_from_message(
msg: &'a Message,
hdr: &Header<'_>,
) -> Result<Self, AtspiError>where
Self: Sized + 'a,
fn try_from_message(
msg: &'a Message,
hdr: &Header<'_>,
) -> Result<Self, AtspiError>where
Self: Sized + 'a,
Convert a zbus::Message into this event type.
Does all the validation for you.
§Errors
- The message does not have an interface:
AtspiError::MissingInterface - The message interface does not match the one for the event:
AtspiError::InterfaceMatch - The message does not have an member:
AtspiError::MissingMember - The message member does not match the one for the event:
AtspiError::MemberMatch - The message signature does not match the one for the event:
AtspiError::SignatureMatch
See MessageConversion::from_message_unchecked for info on panic condition that should never
happen.
Provided Methods§
Sourcefn validate_interface(header: &Header<'_>) -> Result<(), AtspiError>
fn validate_interface(header: &Header<'_>) -> Result<(), AtspiError>
Validate the interface string via zbus::message::Header::interface against Self’s assignment of DBusInterface::DBUS_INTERFACE
§Errors
AtspiError::MissingInterfaceif there is no interfaceAtspiError::InterfaceMatchif the interfaces do not match
Sourcefn validate_member(hdr: &Header<'_>) -> Result<(), AtspiError>
fn validate_member(hdr: &Header<'_>) -> Result<(), AtspiError>
Validate the member string via zbus::message::Header::member against Self’s assignment of DBusMember::DBUS_MEMBER
§Errors
AtspiError::MissingMemberif there is no memberAtspiError::MemberMatchif the members do not match
Sourcefn validate_body(msg: &Message) -> Result<(), AtspiError>
fn validate_body(msg: &Message) -> Result<(), AtspiError>
Validate the body signature against the zvariant::Signature of MessageConversion::Body
§Errors
AtspiError::SignatureMatchif the signatures do not match
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.