ErrorContextExt

Trait ErrorContextExt 

Source
pub trait ErrorContextExt<T> {
    // Required methods
    fn file_context(self, operation: &str, path: &Path) -> Result<T>;
    fn git_context(self, command: &str, repo: Option<&str>) -> Result<T>;
    fn manifest_context(
        self,
        operation: &str,
        details: Option<&str>,
    ) -> Result<T>;
    fn dependency_context(self, dependency: &str, reason: &str) -> Result<T>;
    fn network_context(self, operation: &str, url: Option<&str>) -> Result<T>;
}
Expand description

Helper trait to easily attach error contexts

Required Methods§

Source

fn file_context(self, operation: &str, path: &Path) -> Result<T>

Attach a file error context

Source

fn git_context(self, command: &str, repo: Option<&str>) -> Result<T>

Attach a git error context

Source

fn manifest_context(self, operation: &str, details: Option<&str>) -> Result<T>

Attach a manifest error context

Source

fn dependency_context(self, dependency: &str, reason: &str) -> Result<T>

Attach a dependency error context

Source

fn network_context(self, operation: &str, url: Option<&str>) -> Result<T>

Attach a network error context

Implementations on Foreign Types§

Source§

impl<T, E> ErrorContextExt<T> for Result<T, E>
where E: Error + Send + Sync + 'static,

Source§

fn file_context(self, operation: &str, path: &Path) -> Result<T>

Source§

fn git_context(self, command: &str, repo: Option<&str>) -> Result<T>

Source§

fn manifest_context(self, operation: &str, details: Option<&str>) -> Result<T>

Source§

fn dependency_context(self, dependency: &str, reason: &str) -> Result<T>

Source§

fn network_context(self, operation: &str, url: Option<&str>) -> Result<T>

Implementors§