♻️ Add Session domain entity
This commit is contained in:
1
src/domain/model/mod.rs
Normal file
1
src/domain/model/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub(crate) mod session;
|
26
src/domain/model/session.rs
Normal file
26
src/domain/model/session.rs
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user