Struct code_generator::NewLine
source · pub struct NewLine {}Expand description
The NewLine struct allows the generation info to decide the new line format
Implementations§
source§impl NewLine
impl NewLine
sourcepub fn new() -> NewLine
pub fn new() -> NewLine
Creates a NewLine generator
This struct makes it easy to change the new line format based on the context of the generator.
let new_line = NewLine::new();
let mut info = CodeGenerationInfo::new();
info.set_new_line_type(NewLineType::CrNl);
assert_eq!("\r\n", format!("{}", new_line.display(info)));Trait Implementations§
Auto Trait Implementations§
impl Freeze for NewLine
impl RefUnwindSafe for NewLine
impl Send for NewLine
impl Sync for NewLine
impl Unpin for NewLine
impl UnwindSafe for NewLine
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)