27 lines
625 B
Rust
27 lines
625 B
Rust
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;
|
|
}
|
|
}
|