blob: 07313b0c476726717a8290cd3c050c49138bcd28 [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
pub use tracing::{debug, error, info, warn};
pub trait AsValue<'a> {
type ValueType;
fn as_value(&'a self) -> Self::ValueType;
}
impl<'a> AsValue<'a> for anyhow::Error {
type ValueType = &'a (dyn std::error::Error + 'static);
fn as_value(&'a self) -> Self::ValueType {
self.as_ref()
}
}
impl<'a> AsValue<'a> for fidl::Error {
type ValueType = &'a (dyn std::error::Error + 'static);
fn as_value(&'a self) -> Self::ValueType {
self
}
}