forked from mirrors/gstreamer-rs
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:
parent
b6919d7c99
commit
041a1f2a8e
1 changed files with 18 additions and 0 deletions
|
@ -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")]
|
||||
|
|
Loading…
Reference in a new issue