pub struct Book<E> { /* private fields */ }Expand description
Implementations§
Source§impl<E> Book<E>
impl<E> Book<E>
Sourcepub fn get_sheets(&self) -> &Vec<Page<E>>
pub fn get_sheets(&self) -> &Vec<Page<E>>
Get sheets
Sourcepub fn new(sheets: &Vec<Page<E>>) -> Book<E>where
E: Clone,
pub fn new(sheets: &Vec<Page<E>>) -> Book<E>where
E: Clone,
Create a new Book instance.
§Arguments:
§Returns:
A Book if successful, otherwise a PaginationError is returned.
§Example:
use page_hunter::*;
let sheets: Vec<Page<u32>> = vec![
Page::new(&vec![1, 2], 0, 2, 5).unwrap_or_else(|error| {
panic!("Error creating page model: {:?}", error);
}),
Page::new(&vec![3, 4], 1, 2, 5).unwrap_or_else(|error| {
panic!("Error creating page model: {:?}", error);
}),
];
let book: Book<u32> = Book::new(&sheets);Trait Implementations§
Source§impl<'de, E> Deserialize<'de> for Book<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for Book<E>where
E: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<E> IntoIterator for Book<E>
Implementation of IntoIterator for Book.
impl<E> IntoIterator for Book<E>
Implementation of IntoIterator for Book.
Auto Trait Implementations§
impl<E> Freeze for Book<E>
impl<E> RefUnwindSafe for Book<E>where
E: RefUnwindSafe,
impl<E> Send for Book<E>where
E: Send,
impl<E> Sync for Book<E>where
E: Sync,
impl<E> Unpin for Book<E>where
E: Unpin,
impl<E> UnwindSafe for Book<E>where
E: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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