pub struct CharsetEncodeError { /* private fields */ }Expand description
Error reported by a charset encoder.
The error always carries the target charset, error kind, and operation
index associated with the failure. For buffer errors this is the caller-supplied
output index. Errors tied to a raw code point or character value expose that
value through Self::kind and Self::value.
Implementations§
Source§impl CharsetEncodeError
impl CharsetEncodeError
Sourcepub const fn new(
charset: Charset,
kind: CharsetEncodeErrorKind,
index: usize,
) -> Self
pub const fn new( charset: Charset, kind: CharsetEncodeErrorKind, index: usize, ) -> Self
Sourcepub const fn required(self) -> Option<usize>
pub const fn required(self) -> Option<usize>
Returns required output units for this encoding error, if reported.
§Returns
Returns Some(required) for CharsetEncodeErrorKind::BufferTooSmall,
otherwise None.
Sourcepub const fn available(self) -> Option<usize>
pub const fn available(self) -> Option<usize>
Returns available output units for this encoding error, if reported.
§Returns
Returns Some(available) for CharsetEncodeErrorKind::BufferTooSmall,
otherwise None.
Sourcepub const fn kind(self) -> CharsetEncodeErrorKind
pub const fn kind(self) -> CharsetEncodeErrorKind
Trait Implementations§
Source§impl Clone for CharsetEncodeError
impl Clone for CharsetEncodeError
Source§fn clone(&self) -> CharsetEncodeError
fn clone(&self) -> CharsetEncodeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CharsetEncodeError
impl Debug for CharsetEncodeError
Source§impl Display for CharsetEncodeError
impl Display for CharsetEncodeError
Source§impl Error for CharsetEncodeError
impl Error for CharsetEncodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CharsetEncodeError> for CharsetConvertError
impl From<CharsetEncodeError> for CharsetConvertError
Source§fn from(source: CharsetEncodeError) -> Self
fn from(source: CharsetEncodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CharsetEncodeError
impl PartialEq for CharsetEncodeError
Source§fn eq(&self, other: &CharsetEncodeError) -> bool
fn eq(&self, other: &CharsetEncodeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CharsetEncodeError
impl Eq for CharsetEncodeError
impl StructuralPartialEq for CharsetEncodeError
Auto Trait Implementations§
impl Freeze for CharsetEncodeError
impl RefUnwindSafe for CharsetEncodeError
impl Send for CharsetEncodeError
impl Sync for CharsetEncodeError
impl Unpin for CharsetEncodeError
impl UnsafeUnpin for CharsetEncodeError
impl UnwindSafe for CharsetEncodeError
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