pub struct ViewLine { /* private fields */ }
Expand description
Represents a line in the view.
Implementations
sourceimpl ViewLine
impl ViewLine
sourcepub fn new_empty_line() -> Self
pub fn new_empty_line() -> Self
Create a new instance that contains no content.
sourcepub fn new_pinned(segments: Vec<LineSegment>) -> Self
pub fn new_pinned(segments: Vec<LineSegment>) -> Self
Create a new instance with all segments pinned.
sourcepub fn new_with_pinned_segments(
segments: Vec<LineSegment>,
pinned_segments: usize
) -> Self
pub fn new_with_pinned_segments(
segments: Vec<LineSegment>,
pinned_segments: usize
) -> Self
Create a new instance with a number of pinned leading segments.
sourcepub const fn set_selected(self, selected: bool) -> Self
pub const fn set_selected(self, selected: bool) -> Self
Set that this line is selected.
sourcepub fn set_padding(self, c: char) -> Self
pub fn set_padding(self, c: char) -> Self
Set a padding character.
sourcepub fn set_padding_with_color_and_style(
self,
c: char,
color: DisplayColor,
dim: bool,
underline: bool,
reverse: bool
) -> Self
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.
sourcepub const fn get_number_of_pinned_segment(&self) -> usize
pub const fn get_number_of_pinned_segment(&self) -> usize
Get the number of pinned line segments.
sourcepub const fn get_segments(&self) -> &Vec<LineSegment>
pub const fn get_segments(&self) -> &Vec<LineSegment>
Get the view line segments.
sourcepub const fn get_selected(&self) -> bool
pub const fn get_selected(&self) -> bool
Is the line selected.
Trait Implementations
sourceimpl From<LineSegment> for ViewLine
impl From<LineSegment> for ViewLine
sourcefn from(line_segment: LineSegment) -> Self
fn from(line_segment: LineSegment) -> Self
Converts to this type from the input type.
sourceimpl From<Vec<LineSegment, Global>> for ViewLine
impl From<Vec<LineSegment, Global>> for ViewLine
sourcefn from(line_segment: Vec<LineSegment>) -> Self
fn from(line_segment: Vec<LineSegment>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ViewLine
impl Send for ViewLine
impl Sync for ViewLine
impl Unpin for ViewLine
impl UnwindSafe for ViewLine
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more