pub struct LinePrefix {
pub text: String,
pub columns: usize,
}Expand description
A synthesized line prefix — what Document::continuation_prefix and
Document::blank_line_prefix build.
columns is deliberately not text.len(): a tab in a marker advances to a
tab stop, so -\tx yields a four-column prefix from a two-byte marker. An
editor sizing a Tab step, a caret’s horizontal home, or an outdent wants the
column count; one writing the prefix into the document wants the bytes.
Fields§
§text: StringThe bytes to write at the head of the line.
columns: usizeTheir width in columns.
Trait Implementations§
Source§impl Clone for LinePrefix
impl Clone for LinePrefix
Source§fn clone(&self) -> LinePrefix
fn clone(&self) -> LinePrefix
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 moreSource§impl Debug for LinePrefix
impl Debug for LinePrefix
Source§impl Default for LinePrefix
impl Default for LinePrefix
Source§fn default() -> LinePrefix
fn default() -> LinePrefix
Returns the “default value” for a type. Read more
impl Eq for LinePrefix
Source§impl PartialEq for LinePrefix
impl PartialEq for LinePrefix
impl StructuralPartialEq for LinePrefix
Auto Trait Implementations§
impl Freeze for LinePrefix
impl RefUnwindSafe for LinePrefix
impl Send for LinePrefix
impl Sync for LinePrefix
impl Unpin for LinePrefix
impl UnsafeUnpin for LinePrefix
impl UnwindSafe for LinePrefix
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