pub struct ReadWithContext<'p> { /* private fields */ }Expand description
Automatically count lines and report them and the path in error messages
Implementations§
Source§impl<'p> ReadWithContext<'p>
impl<'p> ReadWithContext<'p>
pub fn open_path(path: &'p Path) -> Result<ReadWithContext<'p>>
Sourcepub fn easy_read_line(&mut self, line: &mut String) -> Result<bool>
pub fn easy_read_line(&mut self, line: &mut String) -> Result<bool>
“Clean” read_line function: returns true if it did read a line,
false on EOF. Does overwrite line, not append to it. Removes
trailing ‘\n’ if present.
Sourcepub fn err_with_context<T>(&self, err: Error) -> Result<T, Error>
pub fn err_with_context<T>(&self, err: Error) -> Result<T, Error>
Report an error in the context of this file and position
Auto Trait Implementations§
impl<'p> Freeze for ReadWithContext<'p>
impl<'p> RefUnwindSafe for ReadWithContext<'p>
impl<'p> Send for ReadWithContext<'p>
impl<'p> Sync for ReadWithContext<'p>
impl<'p> Unpin for ReadWithContext<'p>
impl<'p> UnwindSafe for ReadWithContext<'p>
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