1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use std::io;
use lber::structures::{Tag, Integer};
use lber::common::TagClass;
use futures::{future, Future};
use tokio_service::Service;
use ldap::{bundle, Ldap, LdapOp, next_req_controls};
use protocol::LdapRequestId;
impl Ldap {
pub fn abandon(&self, msgid: LdapRequestId) ->
Box<Future<Item=(), Error=io::Error>> {
let bundle = bundle(self);
if !bundle.borrow().id_map.contains_key(&msgid) {
return Box::new(future::err(io::Error::new(io::ErrorKind::Other, format!("msgid {} not an active operation", msgid))));
}
let req = Tag::Integer(Integer {
id: 16,
class: TagClass::Application,
inner: msgid as i64
});
let fut = self.call(LdapOp::Solo(req, next_req_controls(self)))
.and_then(|_x| Ok(()));
Box::new(fut)
}
}