diff --git a/src/bibliography/bib_types/in_book.rs b/src/bibliography/bib_types/in_book.rs new file mode 100644 index 0000000..33ce486 --- /dev/null +++ b/src/bibliography/bib_types/in_book.rs @@ -0,0 +1,32 @@ +use crate::bibliography::bib_types::LocalDate; + +/// Source that is part of a book +#[derive(Clone, Debug)] +pub struct InBook { + pub author: String, + pub title: String, + pub position: String, + pub publisher: String, + pub date: LocalDate, + pub volume: Option, + pub series: Option, + pub address: Option, + pub edition: Option, +} + +impl InBook { + /// Creates a new InBook source with only the mandatory values filled + pub fn new(author: String, title: String, position: String, publisher: String, date:LocalDate) -> Self { + Self { + author, + title, + position, + publisher, + date, + volume: None, + series: None, + address: None, + edition: None, + } + } +} \ No newline at end of file diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index e1ff97e..73a1a42 100644 --- a/src/bibliography/bib_types/mod.rs +++ b/src/bibliography/bib_types/mod.rs @@ -2,10 +2,12 @@ use crate::bibliography::bib_types::article::Article; use crate::bibliography::bib_types::book::Book; use chrono::{Date, Local}; use crate::bibliography::bib_types::booklet::Booklet; +use crate::bibliography::bib_types::in_book::InBook; pub mod article; pub mod book; pub mod booklet; +pub mod in_book; pub type LocalDate = Date; @@ -15,7 +17,7 @@ pub enum BibliographyType { Article(Article), Book(Book), Booklet(Booklet), - InBook, + InBook(InBook), InCollection, Manual, Thesis,