pub struct BookViewState {
pub cat: usize,
pub entry: usize,
pub page: usize,
}Fields§
§cat: usize§entry: usize§page: 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 (cat:N, entry:N, prev_page, next_page). Returns true if state changed.
pub fn entries_in_cat<'b>(&self, book: &'b Book) -> Vec<&'b BookEntry>
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