Skip to main content

TableView

Struct TableView 

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

The table view.

Implementations§

Source§

impl TableView

Source

pub fn new(id: impl Into<SharedString>) -> Self

An empty table; id keeps its elements apart from another table’s in the same window.

Source

pub fn with_summarizer(self, by: Arc<dyn Summarizer>) -> Self

Computes the summaries with by (a backend) instead of the CPU.

Source

pub fn set_summaries( &mut self, summaries: Arc<Vec<ColumnSummary>>, cx: &mut Context<'_, Self>, )

Summaries computed elsewhere (a server’s answer, a cache), in column order: shown as they are, nothing computed here until the data or the bins change.

Source

pub fn with_options(self, options: TableOptions) -> Self

With options (set before the data; TableView::set_options later).

Source

pub fn with_style(self, style: TableStyle) -> Self

With style.

Source

pub fn set_options(&mut self, options: TableOptions, cx: &mut Context<'_, Self>)

Changes the options: the summary starts again as they say, the toolbar’s filter clears.

Source

pub fn options(&self) -> &TableOptions

The options.

Source

pub fn set_style(&mut self, style: TableStyle, cx: &mut Context<'_, Self>)

Changes the style.

Source

pub fn style(&self) -> &TableStyle

The style.

Source

pub fn set_row_colors( &mut self, colors: Vec<Option<Hsla>>, cx: &mut Context<'_, Self>, )

Each row’s mark colour, in table order (None: no mark). Set it again with new data.

Source

pub fn selected_rows(&self) -> Vec<usize>

The selected rows (rows of the table, ascending).

Source

pub fn set_selected_rows( &mut self, rows: impl IntoIterator<Item = usize>, cx: &mut Context<'_, Self>, )

Selects rows (rows of the table), as the app decides; no event is sent.

Source

pub fn filter(&self) -> Option<&SharedString>

The toolbar’s filter (None: every row).

Source

pub fn set_filter( &mut self, value: Option<SharedString>, cx: &mut Context<'_, Self>, )

Filters the rows to those whose toolbar column reads value (None: every row); no event is sent.

Source

pub fn filter_values(&self) -> &[SharedString]

The values the toolbar’s menu offers (after its “All” entry).

Source

pub fn shown_rows(&self) -> Vec<usize>

The rows shown, in the order shown (the sort and the filter applied).

Source

pub fn click_row( &mut self, pos: usize, shift: bool, toggle: bool, cx: &mut Context<'_, Self>, )

A click on the row shown at pos (shift: a range; toggle: ctrl or cmd), as a mouse click does; reports the selection.

Source

pub fn set_data(&mut self, data: Arc<TableData>, cx: &mut Context<'_, Self>)

Shows data (its summaries computed off the UI thread); sort, row selection and widths reset; the toolbar’s filter stays when the new data has its value.

Source

pub fn data(&self) -> &Arc<TableData> ⓘ

The table shown.

Source

pub fn set_spec(&mut self, spec: TableSpec, cx: &mut Context<'_, Self>)

The settings (a change of bins or of the text limits computes the summaries again).

Source

pub fn spec(&self) -> &TableSpec

The settings.

Source

pub fn set_roles( &mut self, roles: Vec<Option<SharedString>>, cx: &mut Context<'_, Self>, )

Each column’s role tag, in column order (None: no tag).

Source

pub fn toggle_summary(&mut self, cx: &mut Context<'_, Self>)

Folds or unfolds the summary (none when the options turn it off).

Source

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

The selected column.

Source

pub fn select(&mut self, col: Option<usize>, cx: &mut Context<'_, Self>)

Selects column col (or none), as a click on its summary does.

Source

pub fn summaries(&self) -> Option<&Arc<Vec<ColumnSummary>>>

The summaries, once computed.

Trait Implementations§

Source§

impl EventEmitter<TableEvent> for TableView

Source§

impl Render for TableView

Source§

fn render( &mut self, _: &mut Window, cx: &mut Context<'_, Self>, ) -> impl IntoElement

Render this view into an element tree.

Auto Trait Implementations§

§

impl !RefUnwindSafe for TableView

§

impl !Send for TableView

§

impl !Sync for TableView

§

impl !UnwindSafe for TableView

§

impl Forget for TableView

§

impl Freeze for TableView
where &'static str: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ArcInner<TableData> is !null: Freeze, PhantomData<ArcInner<TableData>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Option<SharedString>>: Freeze, *const ArcInner<Vec<ColumnSummary>> is !null: Freeze, PhantomData<ArcInner<Vec<ColumnSummary>>>: Freeze, *const ArcInner<Vec<usize>> is !null: Freeze, PhantomData<ArcInner<Vec<usize>>>: Freeze, PhantomData<SharedString>: Freeze, *const ArcInner<Vec<Option<Hsla>>> is !null: Freeze, PhantomData<ArcInner<Vec<Option<Hsla>>>>: Freeze, PhantomData<Option<(f64, f64)>>: Freeze, *const LeafNode<usize, SetValZST> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(usize, SetValZST)>>: Freeze, PhantomData<(usize, f32)>: Freeze, *const RcInner<RefCell<UniformListScrollState>> is !null: Freeze, PhantomData<RcInner<RefCell<UniformListScrollState>>>: Freeze, *const RcInner<Cell<f32>> is !null: Freeze, PhantomData<RcInner<Cell<f32>>>: Freeze, *const () is !null: Freeze, PhantomData<((), RunnableMeta)>: Freeze, *const Task<Box<dyn Any + Send + Sync>> is !null: Freeze, PhantomData<Task<Box<dyn Any + Send + Sync>>>: Freeze, PhantomData<fn()>: Freeze, *const ArcInner<Mutex<RawMutex, RendezvousState<()>>> is !null: Freeze, PhantomData<ArcInner<Mutex<RawMutex, RendezvousState<()>>>>: Freeze, *const ArcInner<dyn Summarizer> is !null: Freeze, PhantomData<ArcInner<dyn Summarizer>>: Freeze,

§

impl Move for TableView

§

impl Unpin for TableView
where &'static str: Unpin, Arc<str>: Unpin, Arc<TableData>: Unpin, *const u8 is !null: Unpin, Arc<Vec<ColumnSummary>>: Unpin, Arc<Vec<usize>>: Unpin, Arc<Vec<Option<Hsla>>>: Unpin, *const LeafNode<usize, SetValZST> is !null: Unpin, Box<(usize, SetValZST)>: Unpin, Rc<RefCell<UniformListScrollState>>: Unpin, Rc<Cell<f32>>: Unpin, Task<(), RunnableMeta>: Unpin, Box<Task<Box<dyn Any + Send + Sync>>>: Unpin, Arc<Mutex<RawMutex, RendezvousState<()>>>: Unpin, Arc<dyn Summarizer>: Unpin,

§

impl UnsafeUnpin for TableView
where &'static str: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ArcInner<TableData> is !null: UnsafeUnpin, PhantomData<ArcInner<TableData>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<Option<SharedString>>: UnsafeUnpin, *const ArcInner<Vec<ColumnSummary>> is !null: UnsafeUnpin, PhantomData<ArcInner<Vec<ColumnSummary>>>: UnsafeUnpin, *const ArcInner<Vec<usize>> is !null: UnsafeUnpin, PhantomData<ArcInner<Vec<usize>>>: UnsafeUnpin, PhantomData<SharedString>: UnsafeUnpin, *const ArcInner<Vec<Option<Hsla>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Vec<Option<Hsla>>>>: UnsafeUnpin, PhantomData<Option<(f64, f64)>>: UnsafeUnpin, *const LeafNode<usize, SetValZST> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(usize, SetValZST)>>: UnsafeUnpin, PhantomData<(usize, f32)>: UnsafeUnpin, *const RcInner<RefCell<UniformListScrollState>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<UniformListScrollState>>>: UnsafeUnpin, *const RcInner<Cell<f32>> is !null: UnsafeUnpin, PhantomData<RcInner<Cell<f32>>>: UnsafeUnpin, *const () is !null: UnsafeUnpin, PhantomData<((), RunnableMeta)>: UnsafeUnpin, *const Task<Box<dyn Any + Send + Sync>> is !null: UnsafeUnpin, PhantomData<Task<Box<dyn Any + Send + Sync>>>: UnsafeUnpin, PhantomData<fn()>: UnsafeUnpin, *const ArcInner<Mutex<RawMutex, RendezvousState<()>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<RawMutex, RendezvousState<()>>>>: UnsafeUnpin, *const ArcInner<dyn Summarizer> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Summarizer>>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more