summaryrefslogtreecommitdiff
path: root/src/database/problem.rs
diff options
context:
space:
mode:
authorDaniel Hader <[email protected]>2026-05-10 10:15:56 -0500
committerDaniel Hader <[email protected]>2026-05-10 10:15:56 -0500
commita005add5513182abb0b1230cf514c7a45b290e4b (patch)
tree5fb5c249d8828ba62f4ae91cbe0e8b5a440be570 /src/database/problem.rs
database with problem model
Diffstat (limited to 'src/database/problem.rs')
-rw-r--r--src/database/problem.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/database/problem.rs b/src/database/problem.rs
new file mode 100644
index 0000000..fdbb2b5
--- /dev/null
+++ b/src/database/problem.rs
@@ -0,0 +1,16 @@
+pub struct Problem {
+ id: i64,
+ title: String,
+ description: String,
+}
+
+impl Problem {
+ pub fn new(id: i64, title: String, description: String) -> Self {
+ Self { id, title, description }
+ }
+
+ pub fn title(&self) -> &str { &self.title }
+ pub fn description(&self) -> &str { &self.description }
+}
+
+