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_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 chrono::{Date, Local};
@ -13,6 +14,7 @@ pub mod booklet;
pub mod in_book;
pub mod in_collection;
pub mod manual;
pub mod tech_report;
pub mod thesis;
pub type LocalDate = Date<Local>;
@ -27,7 +29,7 @@ pub enum BibliographyType {
InCollection(InCollection),
Manual(Manual),
Thesis(Thesis),
TechReport,
TechReport(TechReport),
Unpublished,
Misc,
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
#[derive(Clone, Debug)]
pub struct Thesis {
author: String,
title: String,
school: String,
date: LocalDate,
address: Option<String>,
pub author: String,
pub title: String,
pub school: String,
pub date: LocalDate,
pub address: Option<String>,
}
impl Thesis {

Loading…
Cancel
Save