diff --git a/src/bibliography/bib_types/mod.rs b/src/bibliography/bib_types/mod.rs index 2fbe364..9cb6108 100644 --- a/src/bibliography/bib_types/mod.rs +++ b/src/bibliography/bib_types/mod.rs @@ -6,6 +6,7 @@ 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 crate::bibliography::bib_types::unpublished::Unpublished; use chrono::{Date, Local}; pub mod article; @@ -16,6 +17,7 @@ pub mod in_collection; pub mod manual; pub mod tech_report; pub mod thesis; +pub mod unpublished; pub type LocalDate = Date; @@ -30,7 +32,7 @@ pub enum BibliographyType { Manual(Manual), Thesis(Thesis), TechReport(TechReport), - Unpublished, + Unpublished(Unpublished), Misc, Url, Repository, diff --git a/src/bibliography/bib_types/unpublished.rs b/src/bibliography/bib_types/unpublished.rs new file mode 100644 index 0000000..0c1c057 --- /dev/null +++ b/src/bibliography/bib_types/unpublished.rs @@ -0,0 +1,20 @@ +use crate::bibliography::bib_types::LocalDate; + +/// A source that is not formally published +#[derive(Clone, Debug)] +pub struct Unpublished { + pub author: String, + pub title: String, + pub date: Option, +} + +impl Unpublished { + /// Creates a new source of type unpublished with only the mandatory fields filled + pub fn new(author: String, title: String) -> Self { + Self { + author, + title, + date: None, + } + } +}