Add Unpublished source type

Signed-off-by: trivernis <trivernis@protonmail.com>
main
trivernis 4 years ago
parent fdd119c0c5
commit a181f142fc
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -6,6 +6,7 @@ use crate::bibliography::bib_types::in_collection::InCollection;
use crate::bibliography::bib_types::manual::Manual; use crate::bibliography::bib_types::manual::Manual;
use crate::bibliography::bib_types::tech_report::TechReport; use crate::bibliography::bib_types::tech_report::TechReport;
use crate::bibliography::bib_types::thesis::Thesis; use crate::bibliography::bib_types::thesis::Thesis;
use crate::bibliography::bib_types::unpublished::Unpublished;
use chrono::{Date, Local}; use chrono::{Date, Local};
pub mod article; pub mod article;
@ -16,6 +17,7 @@ pub mod in_collection;
pub mod manual; pub mod manual;
pub mod tech_report; pub mod tech_report;
pub mod thesis; pub mod thesis;
pub mod unpublished;
pub type LocalDate = Date<Local>; pub type LocalDate = Date<Local>;
@ -30,7 +32,7 @@ pub enum BibliographyType {
Manual(Manual), Manual(Manual),
Thesis(Thesis), Thesis(Thesis),
TechReport(TechReport), TechReport(TechReport),
Unpublished, Unpublished(Unpublished),
Misc, Misc,
Url, Url,
Repository, Repository,

@ -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<LocalDate>,
}
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,
}
}
}
Loading…
Cancel
Save