jmap_client/sieve/
get.rs

1/*
2 * Copyright Stalwart Labs LLC See the COPYING
3 * file at the top-level directory of this distribution.
4 *
5 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 * https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 * <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
8 * option. This file may not be copied, modified, or distributed
9 * except according to those terms.
10 */
11
12use crate::{core::get::GetObject, Get, Set};
13
14use super::SieveScript;
15
16impl SieveScript<Get> {
17    pub fn id(&self) -> Option<&str> {
18        self.id.as_deref()
19    }
20
21    pub fn take_id(&mut self) -> String {
22        self.id.take().unwrap_or_default()
23    }
24
25    pub fn name(&self) -> Option<&str> {
26        self.name.as_deref()
27    }
28
29    pub fn blob_id(&self) -> Option<&str> {
30        self.blob_id.as_deref()
31    }
32
33    pub fn is_active(&self) -> bool {
34        self.is_active.unwrap_or(false)
35    }
36}
37
38impl GetObject for SieveScript<Set> {
39    type GetArguments = ();
40}
41
42impl GetObject for SieveScript<Get> {
43    type GetArguments = ();
44}