1use std::borrow::Cow;
5
6use imap_codec::imap_types::{
7 auth::AuthMechanism,
8 command::{Command, CommandBody},
9 core::Tag,
10 secret::Secret,
11};
12
13#[derive(Debug)]
14pub struct CommandAuthenticate {
15 pub tag: Tag<'static>,
16 pub mechanism: AuthMechanism<'static>,
17 pub initial_response: Option<Secret<Cow<'static, [u8]>>>,
18}
19
20impl From<CommandAuthenticate> for Command<'static> {
21 fn from(command_authenticate: CommandAuthenticate) -> Self {
22 Self {
23 tag: command_authenticate.tag,
24 body: CommandBody::Authenticate {
25 mechanism: command_authenticate.mechanism,
26 initial_response: command_authenticate.initial_response,
27 },
28 }
29 }
30}