Skip to main content

HeaderLayout

Struct HeaderLayout 

Source
pub struct HeaderLayout<'a> { /* private fields */ }
Expand description

A collapsed block fold’s one-line display layout: the (inline-fold- aware) header text, the placeholder gap, then the fold’s real closing tail — fn main() { … }. The single source for the placeholder render, caret placement on the tail, selection washes, hit-testing, the hover-chip rect, and the preview anchor, so they agree to the pixel by construction.

Implementations§

Source§

impl<'a> HeaderLayout<'a>

Source

pub fn head(&self) -> &RowLayout<'a>

The header row’s projection (for hits resolving to HeaderHit::Head).

Source

pub fn head_cells(&self) -> u32

Rendered display width of the header text — where the placeholder gap begins. Inline-fold aware: a collapsed inline fold before the block’s opener shrinks it.

Source

pub fn gap_center(&self) -> f32

The fractional cell at the center of the gap, where the chip and its glyph both center.

Source

pub fn tail_cell(&self) -> u32

The display cell where the inline closing tail begins.

Source

pub fn last_row(&self) -> BufferRow

The fold’s last buffer row (the tail’s real home).

Source

pub fn tail_start_col(&self) -> u32

Byte column on the last row where the visible tail starts.

Source

pub fn tail_col_cell(&self, col: u32) -> Option<u32>

Byte column on the last row → display cell on the header row, using full-line tab stops (the caret/hit/selection convention). None for a column in the leading whitespace before the visible tail.

Source

pub fn tail_cells(&self) -> u32

The tail’s rendered width in cells.

Source

pub fn width(&self) -> u32

The collapsed line’s total rendered width (head + gap + tail), in cells.

Source

pub fn tail_glyphs(&self) -> impl Iterator<Item = TailGlyph> + '_

The visible tail glyphs at their header-row display cells.

Source

pub fn hit(&self, cell: f32, bias: Bias) -> HeaderHit

Resolve a (fractional) display cell on the collapsed header line to the region it falls in, with the ±half-cell boundaries the hit-test has always used: at/after the tail (minus half a cell) → the tail column; past the header text (plus half a cell) → the gap; else the head.

Auto Trait Implementations§

§

impl<'a> Freeze for HeaderLayout<'a>

§

impl<'a> RefUnwindSafe for HeaderLayout<'a>

§

impl<'a> Send for HeaderLayout<'a>

§

impl<'a> Sync for HeaderLayout<'a>

§

impl<'a> Unpin for HeaderLayout<'a>

§

impl<'a> UnsafeUnpin for HeaderLayout<'a>

§

impl<'a> UnwindSafe for HeaderLayout<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.