pub struct Client { /* private fields */ }
Implementations§
Source§impl Client
impl Client
pub fn new(host: &str, port: &str) -> Client
pub fn enable_rpc_compaction(&mut self) -> &mut Client
Sourcepub fn create(
&mut self,
) -> Result<TSIServiceSyncClient<Box<dyn TInputProtocol>, Box<dyn TOutputProtocol>>>
pub fn create( &mut self, ) -> Result<TSIServiceSyncClient<Box<dyn TInputProtocol>, Box<dyn TOutputProtocol>>>
Examples found in repository?
examples/main.rs (line 13)
8fn main() -> Result<(), Error> {
9 // create client 4 ways
10 // let client = Client::new("localhost", "6667").create();
11 // let client = Client::new("localhost", "6667").enable_rpc_compaction().create();
12 // let client = Client::default().enable_rpc_compaction().create()?;
13 let client = Client::default().create()?;
14
15 // open a session
16 let mut session = Session::new(client);
17
18 // config session
19 let mut config_map = HashMap::new();
20 config_map.insert("", "");
21
22 // session
23 // .user("root")
24 // .password("root")
25 // .fetch_size(2048)
26 // .zone_id("UTC+8")
27 // .config("", "")
28 // .config_map(config_map)
29 // .open()?;
30
31 // using default config
32 session.open()?;
33
34 let res = session.query("SHOW TIMESERIES root")?;
35 println!("{:#?}", res);
36 pretty::result_set(res);
37
38 session.close()?;
39
40 Ok(())
41}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more