pub struct TableView { /* private fields */ }Expand description
The table view.
Implementations§
Source§impl TableView
impl TableView
Sourcepub fn new(id: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>) -> Self
An empty table; id keeps its elements apart from another table’s in the same window.
Sourcepub fn with_summarizer(self, by: Arc<dyn Summarizer>) -> Self
pub fn with_summarizer(self, by: Arc<dyn Summarizer>) -> Self
Computes the summaries with by (a backend) instead of the CPU.
Sourcepub fn set_summaries(
&mut self,
summaries: Arc<Vec<ColumnSummary>>,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn with_options(self, options: TableOptions) -> Self
pub fn with_options(self, options: TableOptions) -> Self
With options (set before the data; TableView::set_options later).
Sourcepub fn with_style(self, style: TableStyle) -> Self
pub fn with_style(self, style: TableStyle) -> Self
With style.
Sourcepub fn set_options(&mut self, options: TableOptions, cx: &mut Context<'_, Self>)
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.
Sourcepub fn options(&self) -> &TableOptions
pub fn options(&self) -> &TableOptions
The options.
Sourcepub fn set_style(&mut self, style: TableStyle, cx: &mut Context<'_, Self>)
pub fn set_style(&mut self, style: TableStyle, cx: &mut Context<'_, Self>)
Changes the style.
Sourcepub fn style(&self) -> &TableStyle
pub fn style(&self) -> &TableStyle
The style.
Sourcepub fn set_row_colors(
&mut self,
colors: Vec<Option<Hsla>>,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn selected_rows(&self) -> Vec<usize>
pub fn selected_rows(&self) -> Vec<usize>
The selected rows (rows of the table, ascending).
Sourcepub fn set_selected_rows(
&mut self,
rows: impl IntoIterator<Item = usize>,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn filter(&self) -> Option<&SharedString>
pub fn filter(&self) -> Option<&SharedString>
The toolbar’s filter (None: every row).
Sourcepub fn set_filter(
&mut self,
value: Option<SharedString>,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn filter_values(&self) -> &[SharedString]
pub fn filter_values(&self) -> &[SharedString]
The values the toolbar’s menu offers (after its “All” entry).
Sourcepub fn shown_rows(&self) -> Vec<usize>
pub fn shown_rows(&self) -> Vec<usize>
The rows shown, in the order shown (the sort and the filter applied).
Sourcepub fn click_row(
&mut self,
pos: usize,
shift: bool,
toggle: bool,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn set_data(&mut self, data: Arc<TableData>, cx: &mut Context<'_, Self>)
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.
Sourcepub fn set_spec(&mut self, spec: TableSpec, cx: &mut Context<'_, Self>)
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).
Sourcepub fn set_roles(
&mut self,
roles: Vec<Option<SharedString>>,
cx: &mut Context<'_, Self>,
)
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).
Sourcepub fn toggle_summary(&mut self, cx: &mut Context<'_, Self>)
pub fn toggle_summary(&mut self, cx: &mut Context<'_, Self>)
Folds or unfolds the summary (none when the options turn it off).
Trait Implementations§
impl EventEmitter<TableEvent> for TableView
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 TableViewwhere
&'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 TableViewwhere
&'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 TableViewwhere
&'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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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