pub struct TabPolicy { /* private fields */ }Expand description
A fixed-width replacement for one tab during text layout.
A policy without a marker produces width spaces. A policy with a marker
writes that printable text first and pads its right side with spaces until
the replacement occupies width cells. Literal tabs are preserved only by
the non-layout text renderer; resolved views never contain them.
Implementations§
Source§impl TabPolicy
impl TabPolicy
Sourcepub fn with_marker(
width: u16,
marker: impl Into<String>,
) -> Result<Self, InvalidTabMarker>
pub fn with_marker( width: u16, marker: impl Into<String>, ) -> Result<Self, InvalidTabMarker>
Replaces each tab with marker, padded on the right to width cells.
An empty marker is canonicalized to no marker. Other markers must be printable text on one line, have no zero-width graphemes, and fit inside the requested width.
Trait Implementations§
impl Eq for TabPolicy
impl StructuralPartialEq for TabPolicy
Auto Trait Implementations§
impl Freeze for TabPolicy
impl RefUnwindSafe for TabPolicy
impl Send for TabPolicy
impl Sync for TabPolicy
impl Unpin for TabPolicy
impl UnsafeUnpin for TabPolicy
impl UnwindSafe for TabPolicy
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