summaryrefslogtreecommitdiffstats
path: root/src/client.rs
blob: b3ff6bb0fc96ef5ac56cba10b957584b09c4969b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::{ops::{Deref, DerefMut}, sync::Arc};

use jid::BareJID;
use leptos::prelude::*;

use crate::files::Files;

#[derive(Clone)]
pub struct Client {
    // TODO: not pub
    pub client: filamento::Client<Files>,
    pub resource: ArcRwSignal<Option<String>>,
    pub jid: Arc<BareJID>,
    pub file_store: Files,
}

impl Deref for Client {
    type Target = filamento::Client<Files>;

    fn deref(&self) -> &Self::Target {
        &self.client
    }
}

impl DerefMut for Client {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.client
    }
}