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: u32column_number: u32indent_level: u8line_start_indent_level: u8indent_width: u8expect_newline_next: boolImplementations
sourceimpl 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
Trait Implementations
sourceimpl Clone for WriterInfo
impl Clone for WriterInfo
sourcefn clone(&self) -> WriterInfo
fn clone(&self) -> WriterInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for WriterInfo
impl Send for WriterInfo
impl Sync for WriterInfo
impl Unpin for WriterInfo
impl UnwindSafe for WriterInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more