From efd66388f372aa77674b1b80d3ad54a0a63201ba Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 31 Aug 2020 21:15:22 +0200 Subject: [PATCH] Add booklet source --- src/bibliography/bib_types/booklet.rs | 24 ++++++++++++++++++++++++ src/bibliography/bib_types/mod.rs | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/bibliography/bib_types/booklet.rs diff --git a/src/bibliography/bib_types/booklet.rs b/src/bibliography/bib_types/booklet.rs new file mode 100644 index 0000000..528fb61 --- /dev/null +++ b/src/bibliography/bib_types/booklet.rs @@ -0,0 +1,24 @@ +use crate::bibliography::bib_types::LocalDate; + +/// A booklet source where only the title can be known +#[derive(Clone, Debug)] +pub struct Booklet { + pub title: String, + pub author: Option, + pub how_published: Option, + pub address: Option, + pub date: Option, +} + +impl Booklet { + /// Creates a new booklet with only the mandatory values + pub fn new(title: String) -> Self { + Self { + title, + author: None, + how_published: None, + address: None, + date: None, + } + } +} \ No newline at end of file diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index 574a856..e1ff97e 100644 --- a/src/bibliography/bib_types/mod.rs +++ b/src/bibliography/bib_types/mod.rs @@ -1,9 +1,11 @@ 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; pub mod article; pub mod book; +pub mod booklet; pub type LocalDate = Date; @@ -12,7 +14,7 @@ pub type LocalDate = Date; pub enum BibliographyType { Article(Article), Book(Book), - Booklet, + Booklet(Booklet), InBook, InCollection, Manual,