pub struct LogTailer { /* private fields */ }Expand description
Follows one node’s log directory.
Implementations§
Source§impl LogTailer
impl LogTailer
pub fn new(node_id: u32, log_dir: PathBuf) -> Self
pub fn node_id(&self) -> u32
pub fn log_dir(&self) -> &Path
Sourcepub fn mark_primed(&mut self)
pub fn mark_primed(&mut self)
Adopt existing offsets rather than joining at the end.
Called when the persisted offsets already mention this node, i.e. the daemon is restarting rather than the user enabling forwarding for the first time.
Sourcepub async fn poll(
&mut self,
offsets: &mut OffsetStore,
min_level: LogLevel,
) -> Result<PollOutcome>
pub async fn poll( &mut self, offsets: &mut OffsetStore, min_level: LogLevel, ) -> Result<PollOutcome>
Read whatever has been appended since the last poll.
Events below min_level are dropped here rather than downstream, so they never occupy queue
space: the endpoint discards them on arrival anyway, and shipping them would spend the
user’s bandwidth for nothing.
Auto Trait Implementations§
impl Freeze for LogTailer
impl RefUnwindSafe for LogTailer
impl Send for LogTailer
impl Sync for LogTailer
impl Unpin for LogTailer
impl UnsafeUnpin for LogTailer
impl UnwindSafe for LogTailer
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> 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