Add InBook source

main
trivernis 4 years ago
parent efd66388f3
commit 7b1bc9b3d3

@ -0,0 +1,32 @@
use crate::bibliography::bib_types::LocalDate;
/// Source that is part of a book
#[derive(Clone, Debug)]
pub struct InBook {
pub author: String,
pub title: String,
pub position: String,
pub publisher: String,
pub date: LocalDate,
pub volume: Option<String>,
pub series: Option<String>,
pub address: Option<String>,
pub edition: Option<String>,
}
impl InBook {
/// Creates a new InBook source with only the mandatory values filled
pub fn new(author: String, title: String, position: String, publisher: String, date:LocalDate) -> Self {
Self {
author,
title,
position,
publisher,
date,
volume: None,
series: None,
address: None,
edition: None,
}
}
}

@ -2,10 +2,12 @@ use crate::bibliography::bib_types::article::Article;
use crate::bibliography::bib_types::book::Book;
use chrono::{Date, Local};
use crate::bibliography::bib_types::booklet::Booklet;
use crate::bibliography::bib_types::in_book::InBook;
pub mod article;
pub mod book;
pub mod booklet;
pub mod in_book;
pub type LocalDate = Date<Local>;
@ -15,7 +17,7 @@ pub enum BibliographyType {
Article(Article),
Book(Book),
Booklet(Booklet),
InBook,
InBook(InBook),
InCollection,
Manual,
Thesis,

Loading…
Cancel
Save