Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-12-20 20:18:32 +0300
committerSebastian Dröge <sebastian@centricular.com>2017-12-20 20:18:32 +0300
commit8e1428c0473817f7be6db9972284078b00ef0a7a (patch)
tree8884fc24c953e5622d362c7cb321934bf21c12bb
parenta99522150b3bb323912f274db7d3b10af9f309fd (diff)
Implement Error/Display for AdapterError
-rw-r--r--gst-plugin/src/adapter.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/gst-plugin/src/adapter.rs b/gst-plugin/src/adapter.rs
index 4c93faf6d..ddebde027 100644
--- a/gst-plugin/src/adapter.rs
+++ b/gst-plugin/src/adapter.rs
@@ -9,6 +9,8 @@
use std::collections::VecDeque;
use std::cmp;
use std::io;
+use std::fmt;
+use std::error::Error;
use gst;
use gst::prelude::*;
@@ -35,6 +37,18 @@ pub enum AdapterError {
NotEnoughData,
}
+impl fmt::Display for AdapterError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "Not enough data")
+ }
+}
+
+impl Error for AdapterError {
+ fn description(&self) -> &str {
+ "Not enough data"
+ }
+}
+
impl Adapter {
pub fn new() -> Adapter {
Adapter {