[][src]Struct meli::components::utilities::Pager

pub struct Pager {
    text: String,
    cursor: (usize, usize),
    reflow: Reflow,
    height: usize,
    width: usize,
    minimum_width: usize,
    search: Option<SearchPattern>,
    dirty: bool,
    colors: ThemeAttribute,
    initialised: bool,
    show_scrollbar: bool,
    content: CellBuffer,
    text_lines: (usize, Vec<String>),
    movement: Option<PageMovement>,
    id: ComponentId,
}

A pager for text. Pager holds its own content in its own CellBuffer and when draw is called, it draws the current view of the text. It is responsible for scrolling etc.

Fields

text: Stringcursor: (usize, usize)reflow: Reflowheight: usizewidth: usizeminimum_width: usizesearch: Option<SearchPattern>dirty: boolcolors: ThemeAttributeinitialised: boolshow_scrollbar: boolcontent: CellBuffertext_lines: (usize, Vec<String>)movement: Option<PageMovement>id: ComponentId

Implementations

impl Pager[src]

pub const DESCRIPTION: &'static str[src]

pub fn new(context: &Context) -> Self[src]

pub fn set_show_scrollbar(&mut self, new_val: bool) -> &mut Self[src]

pub fn set_colors(&mut self, new_val: ThemeAttribute) -> &mut Self[src]

pub fn set_reflow(&mut self, new_val: Reflow) -> &mut Self[src]

pub fn set_initialised(&mut self, new_val: bool) -> &mut Self[src]

pub fn reflow(&self) -> Reflow[src]

pub fn update_from_str(&mut self, text: &str, width: Option<usize>)[src]

pub fn from_string(
    text: String,
    context: Option<&Context>,
    cursor_pos: Option<usize>,
    width: Option<usize>,
    colors: ThemeAttribute
) -> Self
[src]

pub fn from_str(
    text: &str,
    cursor_pos: Option<usize>,
    width: Option<usize>,
    colors: ThemeAttribute
) -> Self
[src]

pub fn from_buf(content: CellBuffer, cursor_pos: Option<usize>) -> Self[src]

pub fn print_string(
    content: &mut CellBuffer,
    lines: &[String],
    colors: ThemeAttribute
)
[src]

pub fn cursor_pos(&self) -> usize[src]

pub fn size(&self) -> (usize, usize)[src]

Trait Implementations

impl Clone for Pager[src]

impl Component for Pager[src]

impl Debug for Pager[src]

impl Default for Pager[src]

impl Display for Pager[src]

Auto Trait Implementations

impl RefUnwindSafe for Pager

impl Send for Pager

impl Sync for Pager

impl Unpin for Pager

impl UnwindSafe for Pager

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.

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

impl<T> WithSubscriber for T[src]