diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index b8042b1..2fbe364 100644 --- a/src/bibliography/bib_types/mod.rs +++ b/src/bibliography/bib_types/mod.rs @@ -4,6 +4,7 @@ use crate::bibliography::bib_types::booklet::Booklet; use crate::bibliography::bib_types::in_book::InBook; use crate::bibliography::bib_types::in_collection::InCollection; use crate::bibliography::bib_types::manual::Manual; +use crate::bibliography::bib_types::tech_report::TechReport; use crate::bibliography::bib_types::thesis::Thesis; use chrono::{Date, Local}; @@ -13,6 +14,7 @@ pub mod booklet; pub mod in_book; pub mod in_collection; pub mod manual; +pub mod tech_report; pub mod thesis; pub type LocalDate = Date; @@ -27,7 +29,7 @@ pub enum BibliographyType { InCollection(InCollection), Manual(Manual), Thesis(Thesis), - TechReport, + TechReport(TechReport), Unpublished, Misc, Url, diff --git a/src/bibliography/bib_types/tech_report.rs b/src/bibliography/bib_types/tech_report.rs new file mode 100644 index 0000000..953ff92 --- /dev/null +++ b/src/bibliography/bib_types/tech_report.rs @@ -0,0 +1,26 @@ +use crate::bibliography::bib_types::LocalDate; + +/// A tech report for example a white paper +#[derive(Clone, Debug)] +pub struct TechReport { + pub author: String, + pub title: String, + pub institution: String, + pub date: LocalDate, + pub number: Option, + pub address: Option, +} + +impl TechReport { + /// Creates a new tech report with only the mandatory fields filled + pub fn new(author: String, title: String, institution: String, date: LocalDate) -> Self { + Self { + author, + title, + institution, + date, + number: None, + address: None, + } + } +} diff --git a/src/bibliography/bib_types/thesis.rs b/src/bibliography/bib_types/thesis.rs index a963bf5..e9fbe27 100644 --- a/src/bibliography/bib_types/thesis.rs +++ b/src/bibliography/bib_types/thesis.rs @@ -3,11 +3,11 @@ use crate::bibliography::bib_types::LocalDate; /// A thesis source entry #[derive(Clone, Debug)] pub struct Thesis { - author: String, - title: String, - school: String, - date: LocalDate, - address: Option, + pub author: String, + pub title: String, + pub school: String, + pub date: LocalDate, + pub address: Option, } impl Thesis {