pub struct IndentLevel {
pub spaces: usize,
pub tabs: usize,
}Expand description
Represents an indentation level as a mix of spaces and tabs.
Fields§
§spaces: usize§tabs: usizeImplementations§
Source§impl IndentLevel
impl IndentLevel
pub fn new(spaces: usize, tabs: usize) -> Self
Sourcepub fn total_width(&self, tab_width: usize) -> usize
pub fn total_width(&self, tab_width: usize) -> usize
Total width in columns, using the given tab width.
Sourcepub fn is_deeper_than(&self, other: &IndentLevel, tab_width: usize) -> bool
pub fn is_deeper_than(&self, other: &IndentLevel, tab_width: usize) -> bool
Returns true if this level is strictly deeper than other.
Trait Implementations§
Source§impl Clone for IndentLevel
impl Clone for IndentLevel
Source§fn clone(&self) -> IndentLevel
fn clone(&self) -> IndentLevel
Returns a duplicate 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 moreSource§impl Debug for IndentLevel
impl Debug for IndentLevel
Source§impl PartialEq for IndentLevel
impl PartialEq for IndentLevel
impl Eq for IndentLevel
impl StructuralPartialEq for IndentLevel
Auto Trait Implementations§
impl Freeze for IndentLevel
impl RefUnwindSafe for IndentLevel
impl Send for IndentLevel
impl Sync for IndentLevel
impl Unpin for IndentLevel
impl UnsafeUnpin for IndentLevel
impl UnwindSafe for IndentLevel
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