pub struct LiveJournalDirReader { /* private fields */ }
Available on crate feature
asynchronous
only.Expand description
Asynchronous variant of the blocking LiveJournalDirReader. Largely works the same way, but instead of completely blocking the current thread, it instead will resolve a future when new events are fired.
use std::path::PathBuf;
use ed_journals::journal::asynchronous::LiveJournalDirReader;
let path = PathBuf::from("somePath");
let mut journal_reader = LiveJournalDirReader::open(&path).unwrap();
while let Some(entry) = journal_reader.next().await {
// Do something with the entry
}
Implementations§
Source§impl LiveJournalDirReader
impl LiveJournalDirReader
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, JournalDirWatcherError>
pub async fn next( &mut self, ) -> Option<Result<JournalEvent, JournalDirWatcherError>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LiveJournalDirReader
impl !RefUnwindSafe for LiveJournalDirReader
impl Send for LiveJournalDirReader
impl Sync for LiveJournalDirReader
impl Unpin for LiveJournalDirReader
impl !UnwindSafe for LiveJournalDirReader
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