Struct NavFeed
pub struct NavFeed(/* private fields */);Expand description
The app’s side of a NavList that stands in a shell around it: the
app shows its places and the chosen one with Self::show, and takes
what the person chose with Self::take_chosen and the section
actions they ran (“New playlist”) with Self::take_section_actions,
the rows they checked with Self::take_checks and what they folded
with Self::take_expands, the menus they asked for with
Self::take_menus and the names they gave with Self::take_renames.
The list reads the feed at every sync and update (NavList::fed_by).
Implementations§
pub fn show(&self, sections: Vec<NavSection>, selected: Option<String>)
pub fn show(&self, sections: Vec<NavSection>, selected: Option<String>)
Show these places, with selected chosen. Cheap when nothing
changed.
pub fn shown(&self) -> Option<(Vec<NavSection>, Option<String>)>
pub fn shown(&self) -> Option<(Vec<NavSection>, Option<String>)>
What the app last showed: the places and the chosen one.
pub fn take_chosen(&self) -> Vec<String>
pub fn take_chosen(&self) -> Vec<String>
The places the person chose since the last call, oldest first.
pub fn take_section_actions(&self) -> Vec<(String, String)>
pub fn take_section_actions(&self) -> Vec<(String, String)>
The section actions the person ran since the last call, as (section id, action id), oldest first.
pub fn take_checks(&self) -> Vec<(String, bool)>
pub fn take_checks(&self) -> Vec<(String, bool)>
The rows the person checked or cleared since the last call, as (place id, now checked), oldest first.
pub fn take_expands(&self) -> Vec<(String, bool)>
pub fn take_expands(&self) -> Vec<(String, bool)>
The sections and rows the person opened or folded since the last call, as (id, now open), oldest first: what the app keeps folded.
pub fn take_item_actions(&self) -> Vec<(String, String)>
pub fn take_item_actions(&self) -> Vec<(String, String)>
The item actions the person ran since the last call, as (place id,
action id), oldest first (NavList::fed_actions).
The menus the person asked for since the last call, as (place or
section id, the row’s lift, where the menu opens), oldest first
(NavList::fed_menus). Hand the lift to ContextMenu::anchor_row
so the row stays marked while its menu is open.
pub fn take_renames(&self) -> Vec<(String, String)>
pub fn take_renames(&self) -> Vec<(String, String)>
The names the person gave rows or sections in place since the last
call, as (id, name), oldest first (NavList::fed_renames).
pub fn begin_rename(&self, id: &str, focus_target: &mut Option<NodeId>)
pub fn begin_rename(&self, id: &str, focus_target: &mut Option<NodeId>)
Open the rename field on the row or section id (its menu’s
Rename), handing the list the keyboard through focus_target, the
one of the event that asked for it (crate::widget::EventCtx). The
name comes back through Self::take_renames.
pub fn set_open(&self, id: &str, open: bool)
pub fn set_open(&self, id: &str, open: bool)
Open or fold the section or row id as the person would (its
menu’s Collapse): the list keeps what the person folds, so the app
asks it rather than showing it folded.
Trait Implementations§
Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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