leetcode_tui_core/
content.rs1pub mod question;
2use question::Questions;
3use topic::Topic;
4
5pub mod topic;
6
7pub mod questions {}
8
9pub struct MainContent {
10 topic: Topic,
11 questions: Questions,
12 visible: bool,
13}
14
15impl MainContent {
16 pub fn is_visible(&self) -> bool {
17 self.visible
18 }
19}
20
21impl MainContent {
22 pub async fn new() -> Self {
23 Self {
24 topic: Topic::new().await,
25 questions: Default::default(),
26 visible: true,
27 }
28 }
29
30 pub fn get_topic_mut(&mut self) -> &mut Topic {
31 &mut self.topic
32 }
33
34 pub fn get_topic(&self) -> &Topic {
35 &self.topic
36 }
37
38 pub fn get_questions_mut(&mut self) -> &mut Questions {
39 &mut self.questions
40 }
41
42 pub fn get_questions(&self) -> &Questions {
43 &self.questions
44 }
45}