Struct Pager

Source
pub struct Pager { /* private fields */ }

Implementations§

Source§

impl Pager

Source

pub fn new<T: AsRef<str>>(string: T, size: Size, text_info: TextInfo) -> Self

panics if size.width() == 0

Source

pub fn scroll_to(&mut self, scroll_position: usize)

Source

pub fn scroll_up_lines(&mut self, num_lines: usize)

Source

pub fn scroll_down_lines(&mut self, num_lines: usize)

Source

pub fn scroll_lines(&mut self, num_lines: isize)

Source

pub fn scroll_up_line(&mut self)

Source

pub fn scroll_down_line(&mut self)

Source

pub fn scroll_up_page(&mut self)

Source

pub fn scroll_down_page(&mut self)

Source

pub fn scroll_to_top(&mut self)

Source

pub fn scroll_to_bottom(&mut self)

Source

pub fn max_scroll_position(&self) -> usize

Source

pub fn scroll_position(&self) -> usize

Source

pub fn size(&self) -> Size

Source

pub fn num_lines(&self) -> usize

Trait Implementations§

Source§

impl View<Pager> for PagerView

Source§

fn view<G: ViewGrid>( &mut self, pager: &Pager, offset: Coord, depth: i32, grid: &mut G, )

Update the cells in grid to describe how a type should be rendered. This mutably borrows self to allow the view to contain buffers/caches which are updated during rendering.
Source§

impl ViewSize<Pager> for PagerView

Source§

fn size(&mut self, pager: &Pager) -> Size

Returns the size in cells of the rectangle containing a ui element. This allows for the implementation of decorator ui components that render a border around some inner element.

Auto Trait Implementations§

§

impl Freeze for Pager

§

impl RefUnwindSafe for Pager

§

impl Send for Pager

§

impl Sync for Pager

§

impl Unpin for Pager

§

impl UnwindSafe for Pager

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.