Skip to main content

List

Struct List 

Source
pub struct List<S = Vec<Row>> { /* private fields */ }

Implementations§

Source§

impl List

Source

pub fn new() -> Self

Source

pub fn with_rows(self, rows: impl IntoIterator<Item = Row>) -> Self

Source

pub fn set_rows(&mut self, rows: impl IntoIterator<Item = Row>)

Source

pub fn push(&mut self, row: Row)

Source

pub fn clear(&mut self)

Source

pub fn rows(&self) -> &[Row]

Source

pub fn selected_row(&self) -> Option<&Row>

Source

pub fn row_mut(&mut self, index: usize) -> Option<&mut Row>

Source§

impl<S: Source> List<S>

Source

pub fn from_source(source: S) -> Self

Source

pub fn keys(self, keys: Keys) -> Self

Source

pub fn paging(self, paging: Paging) -> Self

Source

pub fn source(&self) -> &S

Source

pub fn set_source(&mut self, source: S)

Source

pub fn update(&mut self, change: impl FnOnce(&mut S))

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn selected(&self) -> Option<usize>

Source

pub fn select(&mut self, index: usize)

Source

pub fn select_range(&mut self, range: Option<(usize, usize)>)

Source

pub fn range(&self) -> Option<(usize, usize)>

Source

pub fn top(&self) -> usize

Source

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

Source

pub fn page(&self) -> usize

Source

pub fn columns(&self) -> &[(usize, u16, u16)]

Source

pub fn shown(&self) -> Option<(usize, usize, usize)>

Source

pub fn position(&self) -> Option<(usize, usize)>

Source

pub fn up(&mut self) -> Step

Source

pub fn down(&mut self) -> Step

Source

pub fn page_up(&mut self) -> Step

Source

pub fn page_down(&mut self) -> Step

Source

pub fn first(&mut self) -> Step

Source

pub fn last(&mut self) -> Step

Source

pub fn key(&mut self, key: Key) -> Step

Source

pub fn hit( &self, area: Rect, header: bool, column: u16, row: u16, ) -> Option<usize>

Trait Implementations§

Source§

impl<S: Clone> Clone for List<S>

Source§

fn clone(&self) -> List<S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for List<S>

Source§

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

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

impl Default for List

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<S> Freeze for List<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for List<S>
where S: RefUnwindSafe,

§

impl<S> Send for List<S>
where S: Send,

§

impl<S> Sync for List<S>
where S: Sync,

§

impl<S> Unpin for List<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for List<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for List<S>
where S: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.