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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.