[−][src]Struct gchemol_parser::TextReader
Methods
impl TextReader<BufReader<File>>
[src]
pub fn from_path<P: AsRef<Path>>(p: P) -> Result<Self>
[src]
Build a text reader for file from path p
.
impl<'a> TextReader<Cursor<&'a str>>
[src]
impl<R: Read> TextReader<BufReader<R>>
[src]
impl<R: BufRead + Seek> TextReader<R>
[src]
pub fn seek_line<F>(&mut self, f: F) -> Result<u64> where
F: Fn(&str) -> bool,
[src]
F: Fn(&str) -> bool,
Skip reading until finding a matched line. Return the position before the matched line.
impl<R: BufRead> TextReader<R>
[src]
pub fn read_line(&mut self, buf: &mut String) -> Option<usize>
[src]
Read a new line into buf. Return the length of the new line. Note: the new line is forced to use unix style line ending.
pub fn lines(self) -> impl Iterator<Item = String>
[src]
Returns an iterator over the lines of this reader. Each string returned will not have a line ending.
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
[src]
Read all text into string buf
.
impl<R: BufRead> TextReader<R>
[src]
ⓘImportant traits for Partitions<R, P>pub fn partition_by<P: Partition>(self, p: P) -> Partitions<R, P>
[src]
ⓘImportant traits for Partitions<R, P>
Returns an iterator over n
lines at a time.
impl<R: BufRead> TextReader<R>
[src]
ⓘImportant traits for Chunks<R>pub fn chunks(self, nlines: usize) -> Chunks<R>
[src]
ⓘImportant traits for Chunks<R>
Returns an iterator over n
lines at a time.
impl<R: BufRead> TextReader<R>
[src]
ⓘImportant traits for Partitions<R, P>pub fn terminated_bunches<F>(self, f: F) -> Partitions<R, Terminated<F>> where
F: Fn(&str) -> bool,
[src]
ⓘImportant traits for Partitions<R, P>
F: Fn(&str) -> bool,
Returns an iterator over n
lines at a time.
impl<R: BufRead> TextReader<R>
[src]
ⓘImportant traits for Partitions<R, P>pub fn preceded_bunches<F>(self, f: F) -> Partitions<R, Preceded<F>> where
F: Fn(&str) -> bool,
[src]
ⓘImportant traits for Partitions<R, P>
F: Fn(&str) -> bool,
Returns an iterator over n
lines at a time.
impl<R: BufRead> TextReader<R>
[src]
ⓘImportant traits for Bunches<F, R>pub fn bunches<F>(self, label_fn: F) -> Bunches<F, R> where
F: Fn(&str) -> bool,
[src]
ⓘImportant traits for Bunches<F, R>
F: Fn(&str) -> bool,
Deprecated:
Plan to be removed
Return an iterator over a bunch of lines preceded by a label line.
Trait Implementations
impl<R: Debug + BufRead> Debug for TextReader<R>
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for TextReader<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for TextReader<R> where
R: Send,
R: Send,
impl<R> Sync for TextReader<R> where
R: Sync,
R: Sync,
impl<R> Unpin for TextReader<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for TextReader<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,