Add article source
parent
3efe9df1c4
commit
dec84de7ce
@ -0,0 +1,28 @@
|
|||||||
|
use chrono::{Local, Date};
|
||||||
|
|
||||||
|
/// An article source
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct Article {
|
||||||
|
pub author: String,
|
||||||
|
pub title: String,
|
||||||
|
pub journal: String,
|
||||||
|
pub date: Date<Local>,
|
||||||
|
pub volume: Option<String>,
|
||||||
|
pub number: Option<String>,
|
||||||
|
pub pages: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Article {
|
||||||
|
/// Creates a new article with the mandatory fields filled
|
||||||
|
pub fn new(author: String, title: String, journal: String, date: Date<Local>) -> Self {
|
||||||
|
Self {
|
||||||
|
author,
|
||||||
|
title,
|
||||||
|
journal,
|
||||||
|
date,
|
||||||
|
volume: None,
|
||||||
|
number: None,
|
||||||
|
pages: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue