pub struct Client;Expand description
TCP Client to memcached server
Implementations§
Source§impl Client
impl Client
Sourcepub fn connect(
addr: &SocketAddr,
handle: &Handle,
) -> Box<dyn Future<Item = Connection, Error = MemcacheError>>
pub fn connect( addr: &SocketAddr, handle: &Handle, ) -> Box<dyn Future<Item = Connection, Error = MemcacheError>>
Examples found in repository?
examples/simple.rs (line 14)
10fn main() {
11 let addr = "127.0.0.1:11211".parse().unwrap();
12 let mut lp = Core::new().unwrap();
13
14 let res = Client::connect(&addr, &lp.handle())
15 .and_then(|conn| {
16 conn.set(b"Hello", b"world", 3600)
17 .and_then(move |_| {
18 conn.get(b"Hello")
19 })
20 });
21
22 let val: Vec<u8> = lp.run(res).unwrap();
23 println!("{:?}", val);
24}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