summaryrefslogtreecommitdiffstats
path: root/src/client.rs
blob: 423beaf3c65b894a231b8ef361f284142c6332f5 (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
31
32
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
    }
}