imap_patch_for_async_imap_lite/authenticator.rs
1/// This trait allows for pluggable authentication schemes. It is used by `Client::authenticate` to
2/// [authenticate using SASL](https://tools.ietf.org/html/rfc3501#section-6.2.2).
3pub trait Authenticator {
4 /// The type of the response to the challenge. This will usually be a `Vec<u8>` or `String`.
5 type Response: AsRef<[u8]>;
6
7 /// Each base64-decoded server challenge is passed to `process`.
8 /// The returned byte-string is base64-encoded and then sent back to the server.
9 fn process(&self, challenge: &[u8]) -> Self::Response;
10}