pub struct CharsetDecodePolicy { /* private fields */ }Expand description
Malformed-input policy used by charset decoders and converters.
Implementations§
Source§impl CharsetDecodePolicy
impl CharsetDecodePolicy
Sourcepub const DEFAULT_REPLACEMENT: char = '\u{fffd}'
pub const DEFAULT_REPLACEMENT: char = '\u{fffd}'
Default replacement character used when malformed input is replaced.
Sourcepub const fn new(malformed_action: MalformedAction, replacement: char) -> Self
pub const fn new(malformed_action: MalformedAction, replacement: char) -> Self
Creates a malformed-input policy.
Sourcepub const fn ignore() -> Self
pub const fn ignore() -> Self
Creates an ignore policy with the default replacement retained for metadata.
Sourcepub const fn ignore_with_replacement(replacement: char) -> Self
pub const fn ignore_with_replacement(replacement: char) -> Self
Creates an ignore policy with explicit replacement metadata.
Sourcepub const fn report() -> Self
pub const fn report() -> Self
Creates a report policy with the default replacement retained for metadata.
Sourcepub const fn malformed_action(self) -> MalformedAction
pub const fn malformed_action(self) -> MalformedAction
Returns the malformed-input action.
Sourcepub const fn replacement(self) -> char
pub const fn replacement(self) -> char
Returns the replacement character.
Trait Implementations§
Source§impl Clone for CharsetDecodePolicy
impl Clone for CharsetDecodePolicy
Source§fn clone(&self) -> CharsetDecodePolicy
fn clone(&self) -> CharsetDecodePolicy
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 moreimpl Copy for CharsetDecodePolicy
Source§impl Debug for CharsetDecodePolicy
impl Debug for CharsetDecodePolicy
Source§impl Default for CharsetDecodePolicy
impl Default for CharsetDecodePolicy
impl Eq for CharsetDecodePolicy
Source§impl Hash for CharsetDecodePolicy
impl Hash for CharsetDecodePolicy
Source§impl PartialEq for CharsetDecodePolicy
impl PartialEq for CharsetDecodePolicy
Source§fn eq(&self, other: &CharsetDecodePolicy) -> bool
fn eq(&self, other: &CharsetDecodePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CharsetDecodePolicy
Auto Trait Implementations§
impl Freeze for CharsetDecodePolicy
impl RefUnwindSafe for CharsetDecodePolicy
impl Send for CharsetDecodePolicy
impl Sync for CharsetDecodePolicy
impl Unpin for CharsetDecodePolicy
impl UnsafeUnpin for CharsetDecodePolicy
impl UnwindSafe for CharsetDecodePolicy
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