Struct kinetic::Client
[−]
[src]
pub struct Client<Ch: KineticChannel<T>, T> { // some fields omitted }
The Kinetic device client
The Kinetic device client represents the main point of access for this library
Example
use kinetic::Client; use kinetic::commands::Put; use std::default::Default; let c = Client::new("127.0.0.1:8123").unwrap(); c.send(Put { key: "hello".as_bytes().to_vec(), value: "world".as_bytes().to_vec(), ..Default::default() }).unwrap();
Methods
impl Client<AsyncChannel, Receiver<Result>>
fn new<A: ToSocketAddrs>(addr: A) -> KineticResult<Client<AsyncChannel, Receiver<Result>>>
impl<Ch: KineticChannel<T>, T> Client<Ch, T>
fn new_with_channel<A: ToSocketAddrs>(channel: Ch) -> KineticResult<Client<Ch, T>>
Creates a new Client
with an specific KineticChannel
fn set_cluster_version(&mut self, value: i64)
fn get_config<'r>(&'r self) -> &'r Configuration
Gets the device Configuration
received during handshake
fn get_limits<'r>(&'r self) -> &'r Limits
Gets the device Limits
received during handshake
fn send<C: Command<R>, R: Response>(&self, cmd: C) -> KineticResult<R>
Sends a Command
to the target device an waits for the Response
Arguments
cmd
- ThePinCommand
to be sent.
fn send_with_pin<C: PinCommand<R>, R: Response>(&self, cmd: C, pin: Vec<u8>) -> KineticResult<R>
Sends a PinCommand
to the target device an waits for the Response
Arguments
cmd
- ThePinCommand
to be sent.pin
- The pin to be used.
impl Client<AsyncChannel, Receiver<Result>>
Client
backed by an AsyncChannel