pub fn matches(&self, error: &anyhow::Error) -> bool {
        if let Some(root_cause) = error.root_cause().downcast_ref::<FxfsError>() {
            self == root_cause
        } else {
            false
        }
    }
/// A helper to match against this FxfsError against the root cause of an anyhow::Error.
///
/// The main application of this helper is to allow us to match an anyhow::Error against a
/// specific case of FxfsError in a boolean expression, such as:
///
/// let result: Result<(), anyhow:Error> = foo();
/// match result {
///   Ok(foo) => Ok(foo),
///   Err(e) if &FxfsError::NotFound.matches(e) => { ... }
///   Err(e) => Err(e)
/// }
A helper to match against this FxfsError against the root cause of an anyhow::Error.
The main application of this helper is to allow us to match an anyhow::Error against a
specific case of FxfsError in a boolean expression, such as.


A helper to match against this FxfsError against the root cause of an anyhow :: Error . The main application of this helper is to allow us to match an anyhow :: Error against a specific case of FxfsError in a boolean expression such as .
pub fn matches(&self, error: &anyhow::Error) -> bool {
        if let Some(root_cause) = error.root_cause().downcast_ref::<FxfsError>() {
            self == root_cause
        } else {
            false
        }
    }
pub fn matches ( & self , error : & anyhow :: Error ) -> bool { if let Some ( root_cause ) = error . root_cause ( ) . downcast_ref :: < FxfsError > ( ) { self == root_cause } else { false } }
A helper to match against this FxfsError against the root cause of an anyhow::Error.
A helper to match against this FxfsError against the root cause of an anyhow :: Error .
&self
error
&anyhow::Error
&self
error
&anyhow::Error