exclude_from_backups 0.1.0

Mark files or directories as excluded from backups (for Time Machine on macOS) Can be used to prevent caches and temporary files from bloating backups.
Documentation
use std::error::Error as StdError;
use std::fmt;

#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum Error {
    NotSupported,
    IncompatiblePathCharset,
    ObjcCallFailed,
    SystemCallFailed,
}

impl StdError for Error {
    fn description(&self) -> &str {
        match *self {
            Error::IncompatiblePathCharset => "path can't be converted to UTF-8 C str",
            Error::ObjcCallFailed => "error while calling basic objc functions",
            Error::SystemCallFailed => "unable to exclude the path",
            Error::NotSupported => "excluding not supported on this platform",
        }
    }
}

impl fmt::Display for Error {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.description())
    }
}