twilly/
sync.rs

1/*!
2
3Contains Twilio Sync related functionality.
4
5*/
6pub mod documents;
7pub mod listitems;
8pub mod lists;
9pub mod mapitems;
10pub mod maps;
11pub mod services;
12
13use crate::Client;
14
15use self::services::{Service, Services};
16
17/// Holds Sync related functions accessible
18/// on the client.
19pub struct Sync<'a> {
20    pub client: &'a Client,
21}
22
23impl<'a> Sync<'a> {
24    /// Functions relating to a known Sync Service.
25    ///
26    /// Takes in the SID of the Sync Service to perform actions against.
27    pub fn service<'b: 'a>(&self, sid: &'b str) -> Service {
28        Service {
29            client: self.client,
30            sid,
31        }
32    }
33
34    /// General Sync Service functions.
35    pub fn services(&self) -> Services {
36        Services {
37            client: self.client,
38        }
39    }
40}