pub struct CharsetEncodePolicy { /* private fields */ }Expand description
Unmappable-input policy used by charset encoders and converters.
Implementations§
Source§impl CharsetEncodePolicy
impl CharsetEncodePolicy
Sourcepub const DEFAULT_REPLACEMENT: char = '\u{fffd}'
pub const DEFAULT_REPLACEMENT: char = '\u{fffd}'
Default replacement character used when unmappable input is replaced.
Sourcepub const DEFAULT_FALLBACK_REPLACEMENT: char = '?'
pub const DEFAULT_FALLBACK_REPLACEMENT: char = '?'
Fallback replacement used when the default replacement is unmappable.
Sourcepub const fn new(unmappable_action: UnmappableAction, replacement: char) -> Self
pub const fn new(unmappable_action: UnmappableAction, replacement: char) -> Self
Creates an unmappable-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 unmappable_action(self) -> UnmappableAction
pub const fn unmappable_action(self) -> UnmappableAction
Returns the unmappable-input action.
Sourcepub const fn replacement(self) -> char
pub const fn replacement(self) -> char
Returns the replacement character.
Trait Implementations§
Source§impl Clone for CharsetEncodePolicy
impl Clone for CharsetEncodePolicy
Source§fn clone(&self) -> CharsetEncodePolicy
fn clone(&self) -> CharsetEncodePolicy
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 CharsetEncodePolicy
Source§impl Debug for CharsetEncodePolicy
impl Debug for CharsetEncodePolicy
Source§impl Default for CharsetEncodePolicy
impl Default for CharsetEncodePolicy
impl Eq for CharsetEncodePolicy
Source§impl Hash for CharsetEncodePolicy
impl Hash for CharsetEncodePolicy
Source§impl PartialEq for CharsetEncodePolicy
impl PartialEq for CharsetEncodePolicy
Source§fn eq(&self, other: &CharsetEncodePolicy) -> bool
fn eq(&self, other: &CharsetEncodePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CharsetEncodePolicy
Auto Trait Implementations§
impl Freeze for CharsetEncodePolicy
impl RefUnwindSafe for CharsetEncodePolicy
impl Send for CharsetEncodePolicy
impl Sync for CharsetEncodePolicy
impl Unpin for CharsetEncodePolicy
impl UnsafeUnpin for CharsetEncodePolicy
impl UnwindSafe for CharsetEncodePolicy
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