#[repr(u8)]pub enum LineEnding {
Newline = 10,
Nul = 0,
}Expand description
Line ending of either \n or \0
Used by various utilities that have the option to separate lines by nul
characters instead of \n. Usually, this is specified with the -z or
--zero flag.
The Display implementation writes the character corresponding to the
variant to the formatter.
Variants§
Implementations§
Source§impl LineEnding
impl LineEnding
Sourcepub fn from_zero_flag(is_zero_terminated: bool) -> Self
pub fn from_zero_flag(is_zero_terminated: bool) -> Self
Create a LineEnding from a -z/--zero flag
If is_zero_terminated is true, LineEnding::Nul is returned,
otherwise LineEnding::Newline.
Trait Implementations§
Source§impl Clone for LineEnding
impl Clone for LineEnding
Source§fn clone(&self) -> LineEnding
fn clone(&self) -> LineEnding
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 LineEnding
impl Debug for LineEnding
Source§impl Default for LineEnding
impl Default for LineEnding
Source§fn default() -> LineEnding
fn default() -> LineEnding
Returns the “default value” for a type. Read more
Source§impl Display for LineEnding
impl Display for LineEnding
Source§impl From<LineEnding> for u8
impl From<LineEnding> for u8
Source§fn from(line_ending: LineEnding) -> Self
fn from(line_ending: LineEnding) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LineEnding
impl PartialEq for LineEnding
Source§fn eq(&self, other: &LineEnding) -> bool
fn eq(&self, other: &LineEnding) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LineEnding
impl StructuralPartialEq for LineEnding
Auto Trait Implementations§
impl Freeze for LineEnding
impl RefUnwindSafe for LineEnding
impl Send for LineEnding
impl Sync for LineEnding
impl Unpin for LineEnding
impl UnsafeUnpin for LineEnding
impl UnwindSafe for LineEnding
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