From 2716893612030827ff479f988133fb9de239c439 Mon Sep 17 00:00:00 2001 From: meh Date: Sun, 24 May 2015 16:11:58 +0200 Subject: [PATCH] util/error: add more helpers --- src/util/error.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/util/error.rs b/src/util/error.rs index 5d7eef8..e56cf7e 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -20,6 +20,30 @@ impl Error { pub fn bug() -> Self { Self::new(AVERROR_BUG) } + + pub fn eof() -> Self { + Self::new(AVERROR_EOF) + } + + pub fn exit() -> Self { + Self::new(AVERROR_EXIT) + } + + pub fn external() -> Self { + Self::new(AVERROR_EXTERNAL) + } + + pub fn experimental() -> Self { + Self::new(AVERROR_EXPERIMENTAL) + } + + pub fn unknown() -> Self { + Self::new(AVERROR_UNKNOWN) + } + + pub fn invalid() -> Self { + Self::new(AVERROR_INVALIDDATA) + } } unsafe impl Send for Error { }