[][src]Trait unsegen::base::cursor::CursorTarget

pub trait CursorTarget {
    fn get_width(&self) -> Width;
fn get_height(&self) -> Height;
fn get_cell_mut(
        &mut self,
        x: ColIndex,
        y: RowIndex
    ) -> Option<&mut StyledGraphemeCluster>;
fn get_cell(
        &self,
        x: ColIndex,
        y: RowIndex
    ) -> Option<&StyledGraphemeCluster>;
fn get_default_style(&self) -> Style; fn get_soft_width(&self) -> Width { ... } }

Something that can be written to using a Cursor. A most prominent example would be a Window.

Required methods

fn get_width(&self) -> Width

Return the actual width of the window. Writing to a column outside of this range is not possible.

fn get_height(&self) -> Height

Return the maximum height of the target. Writing to a row outside of this range is not possible.

fn get_cell_mut(
    &mut self,
    x: ColIndex,
    y: RowIndex
) -> Option<&mut StyledGraphemeCluster>

Get the (mutable) cell at the specified position. The implementor must ensure that in the range for x \in [0, Width) and y \in [0, Height) a valid cluster is returned.

fn get_cell(&self, x: ColIndex, y: RowIndex) -> Option<&StyledGraphemeCluster>

Get the cell at the specified position. The implementor must ensure that in the range for x \in [0, Width) and y \in [0, Height) a valid cluster is returned.

fn get_default_style(&self) -> Style

Return the default style that characters of this target should be printed as. This serves as the base for further style modifications while writing to the target.

Loading content...

Provided methods

fn get_soft_width(&self) -> Width

Return the soft or "desired" width of the target. In most cases this is equal to the width. An example where this is not the case would be a terminal with builtin wrapping of lines where it is some cases desirable for the cursor to wrap at the width of the terminal, even though there is no (conceptual) limit of line length.

Loading content...

Implementors

impl CursorTarget for ExtentEstimationWindow[src]

impl<'a> CursorTarget for Window<'a>[src]

Loading content...