♻️ Add Session domain entity

This commit is contained in:
2024-04-10 12:48:01 +02:00
parent eb81b3252c
commit a7bccfa779
6 changed files with 32 additions and 28 deletions

1
src/domain/model/mod.rs Normal file
View File

@@ -0,0 +1 @@
pub(crate) mod session;

View File

@@ -0,0 +1,26 @@
pub struct Session {
pub homeserver_url: Option<String>,
pub username: Option<String>,
pub password: Option<String>,
pub is_logged: bool,
}
impl Session {
pub fn new() -> Self {
Self {
homeserver_url: None,
username: None,
password: None,
is_logged: false,
}
}
pub fn update(
&mut self,
homeserver_url: Option<String>,
username: Option<String>,
password: Option<String>,
) {
self.homeserver_url = homeserver_url;
self.username = username;
self.password = password;
}
}