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
#![allow(clippy::needless_lifetimes)]

use crate::rpc::*;

rpc_interface! {
    trait GolemTerms {
        #[id = "golem.terms"]
        fn are_terms_accepted(&self) -> Result<bool>;

        #[id = "golem.terms.accept"]
        fn accept_terms(&self, enable_monitor: Option<bool>, enable_talkback: Option<bool>) -> Result<()>;

        #[id= "golem.terms.show"]
        fn show_terms(&self) -> Result<String>;
    }
}

pub trait AsGolemTerms: wamp::RpcEndpoint {
    fn as_golem_terms<'a>(&'a self) -> GolemTerms<'a, Self>;
}

impl<Endpoint: wamp::RpcEndpoint> AsGolemTerms for Endpoint {
    fn as_golem_terms<'a>(&'a self) -> GolemTerms<'a, Endpoint> {
        GolemTerms(self.as_invoker())
    }
}