diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index 00013c3..b8042b1 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::thesis::Thesis; use chrono::{Date, Local}; pub mod article; @@ -12,6 +13,7 @@ pub mod booklet; pub mod in_book; pub mod in_collection; pub mod manual; +pub mod thesis; pub type LocalDate = Date; @@ -24,7 +26,7 @@ pub enum BibliographyType { InBook(InBook), InCollection(InCollection), Manual(Manual), - Thesis, + Thesis(Thesis), TechReport, Unpublished, Misc, diff --git a/src/bibliography/bib_types/thesis.rs b/src/bibliography/bib_types/thesis.rs new file mode 100644 index 0000000..a963bf5 --- /dev/null +++ b/src/bibliography/bib_types/thesis.rs @@ -0,0 +1,24 @@ +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, +} + +impl Thesis { + /// Creates a new thesis with only the mandatory fields filled + pub fn new(author: String, title: String, school: String, date: LocalDate) -> Self { + Self { + author, + title, + school, + date, + address: None, + } + } +}