pub struct LogReader { /* private fields */ }Implementations§
Source§impl LogReader
impl LogReader
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Self
pub fn open<P: AsRef<Path>>(path: P) -> Self
Create a log reader for the file at the specified path.
The file is opened when iteration begins. If the file does not exist or is not readable, the first iteration will return an error.
Sourcepub fn filter_action(self, action: Action) -> Self
pub fn filter_action(self, action: Action) -> Self
Filter entries by action type.
Sourcepub fn filter_package(self, package: &str) -> Self
pub fn filter_package(self, package: &str) -> Self
Filter entries by package name (substring match).
Sourcepub fn filter_package_exact(self, package: &str) -> Self
pub fn filter_package_exact(self, package: &str) -> Self
Filter entries by exact package name.
Sourcepub fn since(self, timestamp: DateTime<FixedOffset>) -> Self
pub fn since(self, timestamp: DateTime<FixedOffset>) -> Self
Filter entries since the given timestamp (inclusive).
Sourcepub fn until(self, timestamp: DateTime<FixedOffset>) -> Self
pub fn until(self, timestamp: DateTime<FixedOffset>) -> Self
Filter entries until the given timestamp (inclusive).
Sourcepub fn entries(self) -> impl Iterator<Item = Result<Entry>>
pub fn entries(self) -> impl Iterator<Item = Result<Entry>>
Iterate over every log line as an Entry, in forward order.
Unlike the IntoIterator impl, this yields all line types (commands,
transaction markers, hook and scriptlet output) and ignores the filters.
Sourcepub fn transactions(self) -> impl Iterator<Item = Result<Transaction>>
pub fn transactions(self) -> impl Iterator<Item = Result<Transaction>>
Group package operations into transactions, in forward order.
Each Transaction is delimited by the transaction started and
transaction completed markers and tagged with the most recent pacman
command logged before it. A transaction left open by a truncated log is
still yielded, with completed set to None.