19 lines
385 B
Rust
19 lines
385 B
Rust
use serde::{Deserialize, Serialize};
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Paragraph {
|
|
pub heading: String,
|
|
pub text: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Page {
|
|
pub title: String,
|
|
pub content: Vec<Paragraph>,
|
|
}
|
|
|
|
impl Page {
|
|
pub fn get_page_preview(&self) -> Paragraph {
|
|
self.content[0].clone()
|
|
}
|
|
}
|