pub struct BookViewState {
pub cat: usize,
pub entry: usize,
pub page: usize,
pub at_home: bool,
pub list_spread: usize,
}Fields§
§cat: usize§entry: usize§page: usize§at_home: bool§list_spread: usizeImplementations§
Source§impl BookViewState
impl BookViewState
Sourcepub fn handle(&mut self, ev: &str, book: &Book) -> bool
pub fn handle(&mut self, ev: &str, book: &Book) -> bool
Handle a navigation event string. Returns true if state changed.
Sourcepub fn entries_in_cat<'b>(&self, book: &'b Book) -> Vec<&'b BookEntry>
pub fn entries_in_cat<'b>(&self, book: &'b Book) -> Vec<&'b BookEntry>
All entries in the current category, unfiltered.
Sourcepub fn list_spread_count(&self, book: &Book) -> usize
pub fn list_spread_count(&self, book: &Book) -> usize
How many list spreads the current category needs.
Sourcepub fn list_spread_start(&self) -> usize
pub fn list_spread_start(&self) -> usize
Absolute index of the first entry on the current list spread.
Sourcepub fn entries_visible<'b>(&self, book: &'b Book) -> Vec<&'b BookEntry>
pub fn entries_visible<'b>(&self, book: &'b Book) -> Vec<&'b BookEntry>
The slice of entries visible on the current list spread.
pub fn current_entry<'b>(&self, book: &'b Book) -> Option<&'b BookEntry>
pub fn page_count(&self, book: &Book) -> usize
Trait Implementations§
Source§impl Clone for BookViewState
impl Clone for BookViewState
Source§fn clone(&self) -> BookViewState
fn clone(&self) -> BookViewState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BookViewState
impl Debug for BookViewState
Source§impl Default for BookViewState
impl Default for BookViewState
Source§fn default() -> BookViewState
fn default() -> BookViewState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BookViewState
impl RefUnwindSafe for BookViewState
impl Send for BookViewState
impl Sync for BookViewState
impl Unpin for BookViewState
impl UnsafeUnpin for BookViewState
impl UnwindSafe for BookViewState
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
Mutably borrows from an owned value. Read more