#[repr(u8)]pub enum LineEndingSpec {
Lf = 0,
CrLf = 1,
Preserve = 2,
}Expand description
The line ending setting of a document on the wire.
Variants§
Lf = 0
Write LF whatever the current source uses.
CrLf = 1
Write CRLF whatever the current source uses.
Preserve = 2
Keep the current source’s ending, or LF for a new file.
Implementations§
Source§impl LineEndingSpec
impl LineEndingSpec
Sourcepub(crate) fn resolve(
self,
current: Option<&str>,
) -> Result<LineEnding, LineEndingError>
pub(crate) fn resolve( self, current: Option<&str>, ) -> Result<LineEnding, LineEndingError>
The line ending to write for current, the source when it is read.
§Errors
Returns an error for a carriage return that is not part of a CRLF
pair. Self::Preserve also rejects a source that mixes CRLF and LF.
Trait Implementations§
Source§impl Clone for LineEndingSpec
impl Clone for LineEndingSpec
Source§fn clone(&self) -> LineEndingSpec
fn clone(&self) -> LineEndingSpec
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 LineEndingSpec
Source§impl Debug for LineEndingSpec
impl Debug for LineEndingSpec
Source§impl Default for LineEndingSpec
impl Default for LineEndingSpec
Source§fn default() -> LineEndingSpec
fn default() -> LineEndingSpec
Returns the “default value” for a type. Read more
impl Eq for LineEndingSpec
Source§impl<'ʄ> Facet<'ʄ> for LineEndingSpec
impl<'ʄ> Facet<'ʄ> for LineEndingSpec
Source§impl PartialEq for LineEndingSpec
impl PartialEq for LineEndingSpec
impl StructuralPartialEq for LineEndingSpec
Auto Trait Implementations§
impl Freeze for LineEndingSpec
impl RefUnwindSafe for LineEndingSpec
impl Send for LineEndingSpec
impl Sync for LineEndingSpec
impl Unpin for LineEndingSpec
impl UnsafeUnpin for LineEndingSpec
impl UnwindSafe for LineEndingSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.