pub enum GuestLogFilter {
Off,
Error,
Warn,
Info,
Debug,
Trace,
}Expand description
This type is a unified definition of log level filters between the guest and host.
This is needed because currently the guest uses both the log and tracing crates,
and needs each type of LevelFilter from both crates.
To avoid as much as possible the amount of conversions between the two types, we define a
single type that can be converted to both log::LevelFilter and tracing_core::LevelFilter.
NOTE: This also takes care of the fact that the tracing and log enum types for the log
levels are not guaranteed to have the same discriminants, so we can’t just cast between them.
Variants§
Trait Implementations§
Source§impl Clone for GuestLogFilter
impl Clone for GuestLogFilter
Source§fn clone(&self) -> GuestLogFilter
fn clone(&self) -> GuestLogFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GuestLogFilter
impl Debug for GuestLogFilter
Source§impl From<GuestLogFilter> for LevelFilter
impl From<GuestLogFilter> for LevelFilter
Source§fn from(filter: GuestLogFilter) -> Self
fn from(filter: GuestLogFilter) -> Self
Source§impl From<GuestLogFilter> for LevelFilter
impl From<GuestLogFilter> for LevelFilter
Source§fn from(filter: GuestLogFilter) -> Self
fn from(filter: GuestLogFilter) -> Self
Source§impl From<GuestLogFilter> for u64
Used by the host to convert the GuestLogFilter to a u64 that is passed to the guest via
the C API.
impl From<GuestLogFilter> for u64
Used by the host to convert the GuestLogFilter to a u64 that is passed to the guest via
the C API.
Source§fn from(value: GuestLogFilter) -> Self
fn from(value: GuestLogFilter) -> Self
Source§impl From<LevelFilter> for GuestLogFilter
Used by the host to convert a [tracing_core::LevelFilter] to the intermediary GuestLogFilter
filter that is later converted to u64 and passed to the guest via the C API.
impl From<LevelFilter> for GuestLogFilter
Used by the host to convert a [tracing_core::LevelFilter] to the intermediary GuestLogFilter
filter that is later converted to u64 and passed to the guest via the C API.
Source§impl PartialEq for GuestLogFilter
impl PartialEq for GuestLogFilter
Source§impl TryFrom<u64> for GuestLogFilter
Used by the guest to convert a u64 value passed from the host via the C API to the
intermediary GuestLogFilter filter that is later converted to both
tracing_core::LevelFilter and log::LevelFilter.
impl TryFrom<u64> for GuestLogFilter
Used by the guest to convert a u64 value passed from the host via the C API to the
intermediary GuestLogFilter filter that is later converted to both
tracing_core::LevelFilter and log::LevelFilter.
impl Copy for GuestLogFilter
impl Eq for GuestLogFilter
impl StructuralPartialEq for GuestLogFilter
Auto Trait Implementations§
impl Freeze for GuestLogFilter
impl RefUnwindSafe for GuestLogFilter
impl Send for GuestLogFilter
impl Sync for GuestLogFilter
impl Unpin for GuestLogFilter
impl UnsafeUnpin for GuestLogFilter
impl UnwindSafe for GuestLogFilter
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.