pub struct TextFileReader<'a> { /* private fields */ }
Implementations§
Source§impl<'a> TextFileReader<'a>
TextFileReader
simplifies reading a file for assertions. The struct implements
PartialEq
and fmt::Debug
to simplify debugging.
impl<'a> TextFileReader<'a>
TextFileReader
simplifies reading a file for assertions. The struct implements
PartialEq
and fmt::Debug
to simplify debugging.
§Usage
use std::fs::OpenOptions;
use std::path::Path;
use hide_glue::file_reader::TextFileReader;
let test_output_path = Path::new("/temporary/file/path");
let expected_output_path = Path::new("tests/fixtures/expected.txt");
let test_output = OpenOptions::new()
.write(true)
.create_new(true)
.open(test_output_path).unwrap();
// write some text to the file; don't forget to flush the buffers!
assert_eq!(
TextFileReader::new(test_output_path)
.expect("Failed to read test_output_path file"),
TextFileReader::new(expected_output_path)
.expect("Failed to read expected_output_path file")
);
Trait Implementations§
Source§impl Debug for TextFileReader<'_>
impl Debug for TextFileReader<'_>
Source§impl PartialEq for TextFileReader<'_>
impl PartialEq for TextFileReader<'_>
Auto Trait Implementations§
impl<'a> Freeze for TextFileReader<'a>
impl<'a> RefUnwindSafe for TextFileReader<'a>
impl<'a> Send for TextFileReader<'a>
impl<'a> Sync for TextFileReader<'a>
impl<'a> Unpin for TextFileReader<'a>
impl<'a> UnwindSafe for TextFileReader<'a>
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