rust_forum/src/feature/post.rs

14 lines
275 B
Rust
Raw Normal View History

2024-12-02 23:56:43 +03:00
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Post {
pub poster_email: String,
pub post: String,
}
impl Post {
pub async fn new(poster_email: String, post: String) -> Self {
Self { poster_email, post }
}
}