Struct Client

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

pub fn new(host: &str, port: &str) -> Client

Source

pub fn enable_rpc_compaction(&mut self) -> &mut Client

Source

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§

Source§

impl Default for Client

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.