pub enum EncoderMode {
Sanitize,
Strict,
}Expand description
Controls how the encoder handles characters that are unsafe for the
line-oriented management protocol (\n, \r, \0).
Variants§
Sanitize
Silently strip unsafe characters (default, defensive).
\n, \r, and \0 are removed from all user-supplied strings.
Block body lines equaling "END" are escaped to " END".
Strict
Reject inputs containing unsafe characters with an error.
Encoder::encode returns Err(io::Error) if any field contains
\n, \r, or \0, or if a block body line equals "END".
The inner error can be downcast to EncodeError for structured
matching.
Trait Implementations§
Source§impl Clone for EncoderMode
impl Clone for EncoderMode
Source§fn clone(&self) -> EncoderMode
fn clone(&self) -> EncoderMode
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 Debug for EncoderMode
impl Debug for EncoderMode
Source§impl Default for EncoderMode
impl Default for EncoderMode
Source§fn default() -> EncoderMode
fn default() -> EncoderMode
Returns the “default value” for a type. Read more
Source§impl PartialEq for EncoderMode
impl PartialEq for EncoderMode
impl Copy for EncoderMode
impl Eq for EncoderMode
impl StructuralPartialEq for EncoderMode
Auto Trait Implementations§
impl Freeze for EncoderMode
impl RefUnwindSafe for EncoderMode
impl Send for EncoderMode
impl Sync for EncoderMode
impl Unpin for EncoderMode
impl UnsafeUnpin for EncoderMode
impl UnwindSafe for EncoderMode
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