fleshing out the core a bit more
This commit is contained in:
parent
e05815e550
commit
c8bb484a53
13 changed files with 497 additions and 9 deletions
38
src/rust/core/presentations.rs
Normal file
38
src/rust/core/presentations.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub enum PresKind {
|
||||
Html,
|
||||
#[default]
|
||||
Pdf,
|
||||
Generic,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
pub struct Presentation {
|
||||
title: String,
|
||||
kind: PresKind,
|
||||
}
|
||||
|
||||
impl Presentation {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
title: "".to_string(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_kind(&self) -> &PresKind {
|
||||
&self.kind
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::presentations::{PresKind, Presentation};
|
||||
|
||||
#[test]
|
||||
pub fn test_presentation() {
|
||||
let pres = Presentation::new();
|
||||
assert_eq!(pres.get_kind(), &PresKind::Pdf)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue