Struct unsegen_pager::HighlightInfo[][src]

pub struct HighlightInfo {
    pub style_changes: Vec<Vec<(usize, StyleModifier)>>,
    pub default_style: StyleModifier,
}
Expand description

Result of a highlighting operation (i.e., a call to Highlighter::highlight).

Fields

style_changes: Vec<Vec<(usize, StyleModifier)>>

A map of changes per line. The outer Vec corresponds to lines. The entries of the inner Vec specify that at the specified column index, the given modifier should be applied.

default_style: StyleModifier

Style that will be applied if no other style has been specified.

Implementations

impl HighlightInfo[src]

pub fn none() -> Self[src]

Empty highlighting result that will not apply any style changes.

pub fn get_info_for_line<L: Into<LineIndex>>(
    &self,
    l: L
) -> &Vec<(usize, StyleModifier)>
[src]

Get any style changes for the specified line.

pub fn default_style(&self) -> StyleModifier[src]

Return the default style, i.e., the style that will be applied to text if no modifications are present.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.