gstreamer: message: implement Display on Error, Warning and Info

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1267>
This commit is contained in:
Guillaume Desmottes 2023-05-22 13:39:01 +02:00
parent b6919d7c99
commit 041a1f2a8e

View file

@ -388,6 +388,12 @@ impl Error {
}
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.error())
}
}
declare_concrete_message!(Warning, T);
impl Warning {
#[doc(alias = "gst_message_new_warning")]
@ -458,6 +464,12 @@ impl Warning {
}
}
impl std::fmt::Display for Warning {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.error())
}
}
declare_concrete_message!(Info, T);
impl Info {
#[doc(alias = "gst_message_new_info")]
@ -528,6 +540,12 @@ impl Info {
}
}
impl std::fmt::Display for Info {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.error())
}
}
declare_concrete_message!(Tag, T);
impl Tag {
#[doc(alias = "gst_message_new_tag")]