pub trait BufReadExtWithFormat<Char = char>: BufReadExt<Char>where
Char: CharExt + Into<char> + Copy,
for<'a> &'a [Char]: CharSet<Item = Char>,
for<'a> &'a str: StrExt<'a, Char>,{
// Provided methods
fn try_get_non_skipped<S>(&mut self, skip: S) -> Result<char, StreamError>
where S: CharSet<Item = Char> { ... }
fn try_skip_all<S>(&mut self, skip: S) -> Result<usize, StreamError>
where S: CharSet<Item = Char> { ... }
fn try_get_until_in_line<F>(
&mut self,
pattern: F,
) -> Result<&str, StreamError>
where F: CharSet<Item = Char> { ... }
fn try_get_while_in_line<F>(
&mut self,
pattern: F,
) -> Result<&str, PatternError<StreamError>>
where F: Pattern<Item = Char> { ... }
fn try_get_string_some<S, A>(
&mut self,
skip: S,
accept: A,
) -> Result<&str, PatternError<StreamError>>
where S: CharSet<Item = Char>,
A: Pattern<Item = Char> { ... }
fn try_get_line_trimmed<S>(&mut self, skip: S) -> Result<&str, StreamError>
where S: CharSet<Item = Char> { ... }
fn try_get_line_some_trimmed<S>(
&mut self,
skip: S,
) -> Result<&str, StreamError>
where S: CharSet<Item = Char> { ... }
}Expand description
Extension trait for BufReadExt with CharSet and Pattern.
Provided Methods§
Sourcefn try_get_non_skipped<S>(&mut self, skip: S) -> Result<char, StreamError>where
S: CharSet<Item = Char>,
fn try_get_non_skipped<S>(&mut self, skip: S) -> Result<char, StreamError>where
S: CharSet<Item = Char>,
Get a single non-skipped character.
Sourcefn try_skip_all<S>(&mut self, skip: S) -> Result<usize, StreamError>where
S: CharSet<Item = Char>,
fn try_skip_all<S>(&mut self, skip: S) -> Result<usize, StreamError>where
S: CharSet<Item = Char>,
Skip all skipped characters until a non-skipped character is found or end of file.
Sourcefn try_get_until_in_line<F>(&mut self, pattern: F) -> Result<&str, StreamError>where
F: CharSet<Item = Char>,
fn try_get_until_in_line<F>(&mut self, pattern: F) -> Result<&str, StreamError>where
F: CharSet<Item = Char>,
Read until a character in pattern is found or end of line.
Sourcefn try_get_while_in_line<F>(
&mut self,
pattern: F,
) -> Result<&str, PatternError<StreamError>>where
F: Pattern<Item = Char>,
fn try_get_while_in_line<F>(
&mut self,
pattern: F,
) -> Result<&str, PatternError<StreamError>>where
F: Pattern<Item = Char>,
Read while matching the pattern.
Sourcefn try_get_string_some<S, A>(
&mut self,
skip: S,
accept: A,
) -> Result<&str, PatternError<StreamError>>
fn try_get_string_some<S, A>( &mut self, skip: S, accept: A, ) -> Result<&str, PatternError<StreamError>>
Get a single skipped-separated string.
If current line is empty or all skipped, it will read a new line.
Sourcefn try_get_line_trimmed<S>(&mut self, skip: S) -> Result<&str, StreamError>where
S: CharSet<Item = Char>,
fn try_get_line_trimmed<S>(&mut self, skip: S) -> Result<&str, StreamError>where
S: CharSet<Item = Char>,
Get a single line. The trailing white spaces will be consumed and trimmed.
It can return an empty string.
Sourcefn try_get_line_some_trimmed<S>(&mut self, skip: S) -> Result<&str, StreamError>where
S: CharSet<Item = Char>,
fn try_get_line_some_trimmed<S>(&mut self, skip: S) -> Result<&str, StreamError>where
S: CharSet<Item = Char>,
Get a single not-empty line. Both leading and trailing white spaces will be consumed and trimmed.
Repeatedly read a new line if current line is empty.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.