pub struct Metering { /* private fields */ }Expand description
Appends Records to a log file, one JSON object per line.
Implementations§
Source§impl Metering
impl Metering
Sourcepub fn new(path: &Path) -> Self
pub fn new(path: &Path) -> Self
Opens a meter writing to path. The file is created on first append.
Sourcepub fn append(&self, record: &Record)
pub fn append(&self, record: &Record)
Appends one record.
Opens the file in append mode per record rather than holding a handle: the file may be rotated or truncated between requests, and a stale handle would silently keep writing to a deleted inode. A write failure cannot fail the request that has already been served, so it is logged to stderr instead of propagated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metering
impl RefUnwindSafe for Metering
impl Send for Metering
impl Sync for Metering
impl Unpin for Metering
impl UnsafeUnpin for Metering
impl UnwindSafe for Metering
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more