Function ldap3::ldap_escape

source ·
pub fn ldap_escape<'a, S: Into<Cow<'a, str>>>(lit: S) -> Cow<'a, str>
Expand description

Escape a filter literal.

Literal values appearing in an LDAP filter can contain any character, but some characters (parentheses, asterisk, backslash, NUL) must be escaped in the filter’s string representation. This function does the escaping.

The argument, lit, can be owned or borrowed. The function doesn’t allocate the return value unless there’s need to escape the input.