util/error: add more helpers

This commit is contained in:
meh 2015-05-24 16:11:58 +02:00
parent 112020a1ce
commit 2716893612

View File

@ -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 { }