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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::ldap::LdapString;
use std::borrow::Cow;
#[derive(Debug, PartialEq)]
pub enum Filter<'a> {
And(Vec<Filter<'a>>),
Or(Vec<Filter<'a>>),
Not(Box<Filter<'a>>),
EqualityMatch(AttributeValueAssertion<'a>),
Substrings(SubstringFilter<'a>),
GreaterOrEqual(AttributeValueAssertion<'a>),
LessOrEqual(AttributeValueAssertion<'a>),
Present(LdapString<'a>),
ApproxMatch(AttributeValueAssertion<'a>),
ExtensibleMatch(MatchingRuleAssertion<'a>),
}
#[derive(Debug, PartialEq)]
pub struct PartialAttribute<'a> {
pub attr_type: LdapString<'a>,
pub attr_vals: Vec<AttributeValue<'a>>,
}
#[derive(Debug, PartialEq)]
pub struct Attribute<'a> {
pub attr_type: LdapString<'a>,
pub attr_vals: Vec<AttributeValue<'a>>,
}
#[derive(Debug, PartialEq)]
pub struct AttributeValueAssertion<'a> {
pub attribute_desc: LdapString<'a>,
pub assertion_value: &'a [u8],
}
#[derive(Debug, PartialEq)]
pub struct AttributeDescription<'a>(pub Cow<'a, str>);
#[derive(Debug, PartialEq)]
pub struct MatchingRuleAssertion<'a> {
pub matching_rule: Option<LdapString<'a>>,
pub rule_type: Option<AttributeDescription<'a>>,
pub assertion_value: AssertionValue<'a>,
pub dn_attributes: Option<bool>,
}
#[derive(Debug, PartialEq)]
pub struct MatchingRuleId<'a>(pub Cow<'a, str>);
#[derive(Debug, PartialEq)]
pub struct SubstringFilter<'a> {
pub filter_type: LdapString<'a>,
pub substrings: Vec<Substring<'a>>,
}
#[derive(Debug, PartialEq)]
pub enum Substring<'a> {
Initial(AssertionValue<'a>),
Any(AssertionValue<'a>),
Final(AssertionValue<'a>),
}
#[derive(Debug, PartialEq)]
pub struct AssertionValue<'a>(pub Cow<'a, [u8]>);
#[derive(Debug, PartialEq)]
pub struct AttributeValue<'a>(pub Cow<'a, [u8]>);