pub struct Book {
pub title: String,
pub author: String,
pub metadata: BookMetadata,
}
Expand description
A struct represening a book and its metadata.
Fields§
§title: String
The title of the book.
The author of the book.
metadata: BookMetadata
The book’s metadata.
Trait Implementations§
Source§impl ABQuery for Book
impl ABQuery for Book
Source§const QUERY: &'static str = {
"SELECT\n ZBKLIBRARYASSET.ZTITLE, -- 0 title\n ZBKLIBRARYASSET.ZAUTHOR, -- 1 author\n ZBKLIBRARYASSET.ZASSETID, -- 2 id\n ZBKLIBRARYASSET.ZLASTOPENDATE -- 3 last_opened\n FROM ZBKLIBRARYASSET\n ORDER BY ZBKLIBRARYASSET.ZTITLE;"
}
const QUERY: &'static str = { "SELECT\n ZBKLIBRARYASSET.ZTITLE, -- 0 title\n ZBKLIBRARYASSET.ZAUTHOR, -- 1 author\n ZBKLIBRARYASSET.ZASSETID, -- 2 id\n ZBKLIBRARYASSET.ZLASTOPENDATE -- 3 last_opened\n FROM ZBKLIBRARYASSET\n ORDER BY ZBKLIBRARYASSET.ZTITLE;" }
The query to retrieve rows from the database. The rows are then passed
into
ABQuery::from_row()
to create instances of the implementing
type.Source§fn from_row(row: &Row<'_>) -> Self
fn from_row(row: &Row<'_>) -> Self
Constructs an instance of the implementing type from a
rusqlite::Row
.Source§impl<'a> From<&'a Book> for BookContext<'a>
impl<'a> From<&'a Book> for BookContext<'a>
Auto Trait Implementations§
impl Freeze for Book
impl RefUnwindSafe for Book
impl Send for Book
impl Sync for Book
impl Unpin for Book
impl UnwindSafe for Book
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> 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