[][src]Struct library_catalogue::book::Book

pub struct Book {
    pub title: String,
    pub isbn: ISBN,
    pub pages: u32,
    pub read: Read,
}

Fields

title: Stringisbn: ISBNpages: u32read: Read

Implementations

impl Book[src]

pub fn finish(&mut self)[src]

Marks a book as finished

Affected fields

  • read

Example

 use library_catalogue::book::Book;
 use library_catalogue::book::isbn::ISBN;
 use library_catalogue::book::read::Read;
  
 let mut rust_book = Book {
   title: String::from("The Rust Programming Language"),
   isbn: ISBN::V10(978, 1, 59327, 828, 1),
   pages: 519,
   read: Read::Started
 };
  
rust_book.finish();

pub fn summary(&self) -> String[src]

Prints a summary of the book

Included fields

  • title
  • pages
  • isbn

Trait Implementations

impl Debug for Book[src]

Auto Trait Implementations

impl RefUnwindSafe for Book

impl Send for Book

impl Sync for Book

impl Unpin for Book

impl UnwindSafe for Book

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.