fxfs_crypt/
log.rs

1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5pub use log::{debug, error, info, warn};
6
7pub trait AsValue<'a> {
8    type ValueType;
9
10    fn as_value(&'a self) -> Self::ValueType;
11}
12
13impl<'a> AsValue<'a> for anyhow::Error {
14    type ValueType = &'a (dyn std::error::Error + 'static);
15
16    fn as_value(&'a self) -> Self::ValueType {
17        self.as_ref()
18    }
19}
20
21impl<'a> AsValue<'a> for fidl::Error {
22    type ValueType = &'a (dyn std::error::Error + 'static);
23
24    fn as_value(&'a self) -> Self::ValueType {
25        self
26    }
27}