Add thesis source

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

@ -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_book::InBook;
use crate::bibliography::bib_types::in_collection::InCollection; 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::thesis::Thesis;
use chrono::{Date, Local}; use chrono::{Date, Local};
pub mod article; pub mod article;
@ -12,6 +13,7 @@ pub mod booklet;
pub mod in_book; pub mod in_book;
pub mod in_collection; pub mod in_collection;
pub mod manual; pub mod manual;
pub mod thesis;
pub type LocalDate = Date<Local>; pub type LocalDate = Date<Local>;
@ -24,7 +26,7 @@ pub enum BibliographyType {
InBook(InBook), InBook(InBook),
InCollection(InCollection), InCollection(InCollection),
Manual(Manual), Manual(Manual),
Thesis, Thesis(Thesis),
TechReport, TechReport,
Unpublished, Unpublished,
Misc, Misc,

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