Add TechReport type

Signed-off-by: trivernis <trivernis@protonmail.com>
main
trivernis 4 years ago
parent 0325d6f68e
commit fdd119c0c5
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::tech_report::TechReport;
use crate::bibliography::bib_types::thesis::Thesis; use crate::bibliography::bib_types::thesis::Thesis;
use chrono::{Date, Local}; use chrono::{Date, Local};
@ -13,6 +14,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 tech_report;
pub mod thesis; pub mod thesis;
pub type LocalDate = Date<Local>; pub type LocalDate = Date<Local>;
@ -27,7 +29,7 @@ pub enum BibliographyType {
InCollection(InCollection), InCollection(InCollection),
Manual(Manual), Manual(Manual),
Thesis(Thesis), Thesis(Thesis),
TechReport, TechReport(TechReport),
Unpublished, Unpublished,
Misc, Misc,
Url, Url,

@ -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<String>,
pub address: Option<String>,
}
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,
}
}
}

@ -3,11 +3,11 @@ use crate::bibliography::bib_types::LocalDate;
/// A thesis source entry /// A thesis source entry
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Thesis { pub struct Thesis {
author: String, pub author: String,
title: String, pub title: String,
school: String, pub school: String,
date: LocalDate, pub date: LocalDate,
address: Option<String>, pub address: Option<String>,
} }
impl Thesis { impl Thesis {

Loading…
Cancel
Save