pub trait Utf16ReadExt: ReadBytesExt {
// Provided methods
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 { ... }
}
Expand description
Extension to the Read
trait
Provided Methods§
Sourcefn shorts<T: ByteOrder>(self) -> Shorts<T, Self> ⓘwhere
Self: Sized,
fn shorts<T: ByteOrder>(self) -> Shorts<T, Self> ⓘwhere
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.
Sourcefn utf16_chars<T: ByteOrder>(self) -> Chars<T, Self> ⓘwhere
Self: Sized,
fn utf16_chars<T: ByteOrder>(self) -> Chars<T, Self> ⓘwhere
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>
.
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.