pub struct Search { /* private fields */ }Expand description
One page of a search, fed the log in the batches it asks for:
while let Some(read) = search.wants() { search.read(lines(read)) }, then Search::finish.
Implementations§
Source§impl Search
impl Search
Sourcepub fn new(query: &LogSearchQuery) -> Result<Search, String>
pub fn new(query: &LogSearchQuery) -> Result<Search, String>
A search for query, or why it cannot be made.
Sourcepub fn wants(&self) -> Option<LineRead>
pub fn wants(&self) -> Option<LineRead>
What to read next; None once the page is complete. Scanning reads what is left of the budget; the last
match’s context, at most 5 lines past it.
Sourcepub fn read(&mut self, lines: Vec<StoredLine>)
pub fn read(&mut self, lines: Vec<StoredLine>)
Takes the lines read as Search::wants asked; fewer than asked, short of its bytes, means the log ends.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Search
impl Freeze for Search
impl Move for Search
impl RefUnwindSafe for Search
impl Send for Search
impl Sync for Search
impl Unpin for Search
impl UnsafeUnpin for Search
impl UnwindSafe for Search
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