ViewLine

Struct ViewLine 

Source
pub struct ViewLine { /* private fields */ }
Expand description

Represents a line in the view.

Implementations§

Source§

impl ViewLine

Source

pub fn new_empty_line() -> Self

Create a new instance that contains no content.

Source

pub fn new_pinned(segments: Vec<LineSegment>) -> Self

Create a new instance with all segments pinned.

Source

pub fn new_with_pinned_segments( segments: Vec<LineSegment>, pinned_segments: usize, ) -> Self

Create a new instance with a number of pinned leading segments.

Source

pub const fn set_selected(self, selected: bool) -> Self

Set that this line is selected.

Source

pub fn set_padding(self, c: char) -> Self

Set a padding character.

Source

pub fn set_padding_with_color_and_style( self, c: char, color: DisplayColor, dim: bool, underline: bool, reverse: bool, ) -> Self

Set the padding character with a related color and style.

Source

pub const fn get_number_of_pinned_segment(&self) -> usize

Get the number of pinned line segments.

Source

pub const fn get_segments(&self) -> &Vec<LineSegment>

Get the view line segments.

Source

pub const fn get_selected(&self) -> bool

Is the line selected.

Trait Implementations§

Source§

impl Debug for ViewLine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&str> for ViewLine

Source§

fn from(line: &str) -> Self

Converts to this type from the input type.
Source§

impl From<LineSegment> for ViewLine

Source§

fn from(line_segment: LineSegment) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ViewLine

Source§

fn from(line: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<LineSegment>> for ViewLine

Source§

fn from(line_segment: Vec<LineSegment>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,