pub trait Content<T>: Selectable {
// Required methods
fn selected(&self) -> Option<&T>;
fn content(&self) -> &Vec<T>;
fn push(&mut self, t: T);
fn style(&self, index: usize, style: &Style) -> Style;
}Expand description
Allow access to a content element of any type. It allows to access the selected element, the whole content, to push new elements and to get the style of an element for display.
Its implementation should be done using the crate::impl_content macro
which allows to manipulate any kind of content.
It’s used for almost every menu or list of things, as long as the whole content
is known at some point.
Major exception is crate::modes::FuzzyFinder which doesn’t store the matches.
Required Methods§
Implementors§
impl Content<&'static str> for ContextMenu
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<(char, PathBuf)> for Marks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<Mountable> for Mount
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<Option<PathBuf>> for TempMarks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<String> for Completion
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<String> for Picker
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<String> for TuiApplications
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<PathBuf> for Flagged
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<PathBuf> for History
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<PathBuf> for Shortcut
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<Entry> for OpendalContainer
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.
impl Content<FileInfo> for Directory
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, selected.
selected returns an optional reference to the value.