pub struct UTF8Encoder;Expand description
An encoder for UTF-8.
§Examples
use conversion::converter::encoding::utf8::UTF8Encoder;
use conversion::iter::ConvertedIterator;
let iter = "straße".chars();
let encoded = ConvertedIterator::new(iter, UTF8Encoder::new());
assert_eq!(Ok(b"stra\xc3\x9fe".to_vec()), encoded.collect());Implementations§
Source§impl UTF8Encoder
impl UTF8Encoder
Trait Implementations§
Source§impl Clone for UTF8Encoder
impl Clone for UTF8Encoder
Source§fn clone(&self) -> UTF8Encoder
fn clone(&self) -> UTF8Encoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Converter for UTF8Encoder
impl Converter for UTF8Encoder
Source§type Error = Infallible
type Error = Infallible
The type of errors while conversion.
Source§fn convert<E>(
&mut self,
item: Self::Item,
buf: &mut E,
) -> Result<usize, Self::Error>
fn convert<E>( &mut self, item: Self::Item, buf: &mut E, ) -> Result<usize, Self::Error>
Consumes one item, stores outputs into
buf implements Extend, and returns
the number of stored outputs or a conversion error. If there are no outputs yet,
you should store the item and return Ok(0).Source§impl Debug for UTF8Encoder
impl Debug for UTF8Encoder
Source§impl Default for UTF8Encoder
impl Default for UTF8Encoder
Source§fn default() -> UTF8Encoder
fn default() -> UTF8Encoder
Returns the “default value” for a type. Read more
Source§impl PartialEq for UTF8Encoder
impl PartialEq for UTF8Encoder
impl Copy for UTF8Encoder
impl Eq for UTF8Encoder
impl StructuralPartialEq for UTF8Encoder
Auto Trait Implementations§
impl Freeze for UTF8Encoder
impl RefUnwindSafe for UTF8Encoder
impl Send for UTF8Encoder
impl Sync for UTF8Encoder
impl Unpin for UTF8Encoder
impl UnwindSafe for UTF8Encoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more