Trait basic_text::ReadText
source · pub trait ReadText: ReadStr {
// Required method
fn read_text_substr(&mut self, buf: &mut TextSubstr) -> Result<usize>;
// Provided methods
fn read_exact_text_substr(&mut self, buf: &mut TextSubstr) -> Result<()> { ... }
fn read_to_text_string(&mut self, buf: &mut TextString) -> Result<usize> { ... }
}
Expand description
Add a convenience method for reading Basic Text content.
Required Methods§
sourcefn read_text_substr(&mut self, buf: &mut TextSubstr) -> Result<usize>
fn read_text_substr(&mut self, buf: &mut TextSubstr) -> Result<usize>
Like read_str
but for reading Basic Text content. Note that the
resulting data may not be a Basic Text string, as it may be eg. a
portion of a stream that starts with a non-starter.
Provided Methods§
sourcefn read_exact_text_substr(&mut self, buf: &mut TextSubstr) -> Result<()>
fn read_exact_text_substr(&mut self, buf: &mut TextSubstr) -> Result<()>
Like read_exact_str
but for reading Basic Text content. As with
read_text
, the resulting string may not be a Basic Text string.
sourcefn read_to_text_string(&mut self, buf: &mut TextString) -> Result<usize>
fn read_to_text_string(&mut self, buf: &mut TextString) -> Result<usize>
Like read_to_string
, but reads into a TextString
.