Trait utf16_ext::Utf16ReadExt
[−]
[src]
pub trait Utf16ReadExt: ReadBytesExt { fn shorts<T: ByteOrder>(self) -> Shorts<T, Self>
where
Self: Sized, { ... } fn utf16_chars<T: ByteOrder>(self) -> Chars<T, Self>
where
Self: Sized, { ... } fn read_utf16_line<T: ByteOrder>(
&mut self,
buf: &mut String
) -> Result<usize, Error> { ... } fn utf16_lines<T: ByteOrder>(self) -> Lines<T, Self>
where
Self: Sized, { ... } }
Extension to the Read
trait
Provided Methods
fn shorts<T: ByteOrder>(self) -> Shorts<T, Self> where
Self: Sized,
Self: Sized,
Transforms this instance into an Iterator
over its u16-units (shorts).
The returned type implements Iterator
where the Item
is Result<u16, R::Err>
.
The yielded item is Ok
if a short was successfully read and Err
otherwise.
EOF is mapped to returning None
from this iterator.
fn utf16_chars<T: ByteOrder>(self) -> Chars<T, Self> where
Self: Sized,
Self: Sized,
Transforms this instance into an Iterator
over char
s from utf-16.
The returned type implements Iterator
where the Item
is Result<char, R::Err>
.
fn read_utf16_line<T: ByteOrder>(
&mut self,
buf: &mut String
) -> Result<usize, Error>
&mut self,
buf: &mut String
) -> Result<usize, Error>
Reads all chars (from utf16) until a newline is reached (U+000A) and appends them to the provided buffer.
fn utf16_lines<T: ByteOrder>(self) -> Lines<T, Self> where
Self: Sized,
Self: Sized,
Returns an iterator over the lines of this reader.
Like the normal BufRead::lines
, newlines characters aren't included
Implementors
impl<T: Read> Utf16ReadExt for T