Struct dprint_core::formatting::WriterInfo
source · pub struct WriterInfo {
pub line_number: u32,
pub column_number: u32,
pub indent_level: u8,
pub line_start_indent_level: u8,
pub indent_width: u8,
pub expect_newline_next: bool,
}
Expand description
Information about a certain location being printed.
Fields§
§line_number: u32
§column_number: u32
§indent_level: u8
§line_start_indent_level: u8
§indent_width: u8
§expect_newline_next: bool
Implementations§
source§impl WriterInfo
impl WriterInfo
sourcepub fn is_start_of_line(&self) -> bool
pub fn is_start_of_line(&self) -> bool
Gets if the current column number equals the line start column number or if a newline is expected next.
sourcepub fn is_start_of_line_indented(&self) -> bool
pub fn is_start_of_line_indented(&self) -> bool
Gets if the start of the line is indented.
sourcepub fn is_column_number_at_line_start(&self) -> bool
pub fn is_column_number_at_line_start(&self) -> bool
Gets if the current column number is at the line start column number.
pub fn line_start_column_number(&self) -> u32
sourcepub fn line_and_column(&self) -> (u32, u32)
pub fn line_and_column(&self) -> (u32, u32)
Gets the line and column number.
Trait Implementations§
source§impl Clone for WriterInfo
impl Clone for WriterInfo
source§fn clone(&self) -> WriterInfo
fn clone(&self) -> WriterInfo
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for WriterInfo
impl Send for WriterInfo
impl Sync for WriterInfo
impl Unpin for WriterInfo
impl UnwindSafe for WriterInfo
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