Use cargo-derivefmt to sort derives alphabetically

Used https://github.com/dcchut/cargo-derivefmt

With command:

cargo install --locked \
--git https://github.com/dcchut/cargo-derivefmt \
--bin cargo-derivefmt \
--rev 2ff93de7fb418180458dd1ba27e5655607c23ab6

Since it's not on crates.io at the moment.

Sample diff:

  -#[derive(Debug, Deserialize, Clone, Serialize)]
  +#[derive(Clone, Debug, Deserialize, Serialize)]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/322/head
Manos Pitsidianakis 6 months ago
parent f3e85738e7
commit f900dbea46
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -88,7 +88,7 @@ macro_rules! is_variant {
}; };
} }
#[derive(Debug, Clone, Default)] #[derive(Clone, Debug, Default)]
pub enum MailboxStatus { pub enum MailboxStatus {
Available, Available,
Failed(Error), Failed(Error),
@ -103,7 +103,7 @@ impl MailboxStatus {
is_variant! { is_parsing, Parsing(_, _) } is_variant! { is_parsing, Parsing(_, _) }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct MailboxEntry { pub struct MailboxEntry {
pub status: MailboxStatus, pub status: MailboxStatus,
pub name: String, pub name: String,
@ -168,7 +168,7 @@ impl MailboxEntry {
} }
} }
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub enum IsOnline { pub enum IsOnline {
#[default] #[default]
Uninit, Uninit,
@ -461,7 +461,7 @@ impl Drop for Account {
} }
} }
#[derive(Serialize, Debug, Clone, Default)] #[derive(Clone, Debug, Default, Serialize)]
pub struct MailboxNode { pub struct MailboxNode {
pub hash: MailboxHash, pub hash: MailboxHash,
pub depth: usize, pub depth: usize,

@ -115,7 +115,7 @@ pub mod manpages {
} }
} }
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
/// Choose manpage /// Choose manpage
pub enum ManPages { pub enum ManPages {
/// meli(1) /// meli(1)

@ -111,7 +111,7 @@ pub fn quoted_argument(input: &[u8]) -> IResult<&[u8], &str> {
} }
} }
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct TokenStream { pub struct TokenStream {
tokens: &'static [TokenAdicity], tokens: &'static [TokenAdicity],
} }
@ -225,7 +225,7 @@ impl TokenStream {
/// `Token` wrapper that defines how many times a token is expected to be /// `Token` wrapper that defines how many times a token is expected to be
/// repeated /// repeated
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub enum TokenAdicity { pub enum TokenAdicity {
ZeroOrOne(Token), ZeroOrOne(Token),
ZeroOrMore(Token), ZeroOrMore(Token),
@ -245,7 +245,7 @@ impl TokenAdicity {
} }
/// A token encountered in the UI's command execution bar /// A token encountered in the UI's command execution bar
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub enum Token { pub enum Token {
Literal(&'static str), Literal(&'static str),
Filepath, Filepath,

@ -21,7 +21,7 @@
use super::*; use super::*;
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub enum CommandError { pub enum CommandError {
Parsing { Parsing {
inner: Cow<'static, str>, inner: Cow<'static, str>,

@ -31,7 +31,7 @@ use uuid::Uuid;
use super::*; use super::*;
#[derive(Clone, Copy, Eq, Deserialize, Hash, Ord, PartialOrd, PartialEq, Serialize)] #[derive(Clone, Copy, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
#[repr(transparent)] #[repr(transparent)]
pub struct ComponentId(Uuid); pub struct ComponentId(Uuid);
@ -98,7 +98,7 @@ impl ExtendShortcutsMaps for ShortcutMaps {
} }
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum PageMovement { pub enum PageMovement {
Up(usize), Up(usize),
Right(usize), Right(usize),
@ -110,14 +110,14 @@ pub enum PageMovement {
End, End,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ScrollContext { pub struct ScrollContext {
pub shown_lines: usize, pub shown_lines: usize,
pub total_lines: usize, pub total_lines: usize,
pub has_more_lines: bool, pub has_more_lines: bool,
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum ScrollUpdate { pub enum ScrollUpdate {
End(ComponentId), End(ComponentId),
Update { Update {
@ -266,7 +266,7 @@ impl Default for ComponentAttr {
} }
} }
#[derive(Eq, PartialEq, Debug, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct ComponentPath { pub struct ComponentPath {
pub id: ComponentId, pub id: ComponentId,
pub tail: SmallVec<[ComponentId; 8]>, pub tail: SmallVec<[ComponentId; 8]>,

@ -113,7 +113,7 @@ macro_rules! mailbox_settings {
}}; }};
} }
#[derive(Default, Debug, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct MailUIConf { pub struct MailUIConf {
#[serde(default)] #[serde(default)]
@ -136,7 +136,7 @@ pub struct MailUIConf {
pub pgp: PGPSettingsOverride, pub pgp: PGPSettingsOverride,
} }
#[derive(Debug, Default, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(default)] #[serde(default)]
pub struct FileMailboxConf { pub struct FileMailboxConf {
#[serde(flatten)] #[serde(flatten)]
@ -158,7 +158,7 @@ impl FileMailboxConf {
} }
use crate::conf::deserializers::extra_settings; use crate::conf::deserializers::extra_settings;
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FileAccount { pub struct FileAccount {
pub root_mailbox: String, pub root_mailbox: String,
pub format: String, pub format: String,
@ -204,7 +204,7 @@ impl FileAccount {
} }
} }
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct FileSettings { pub struct FileSettings {
pub accounts: IndexMap<String, FileAccount>, pub accounts: IndexMap<String, FileAccount>,
@ -227,7 +227,7 @@ pub struct FileSettings {
pub log: LogSettings, pub log: LogSettings,
} }
#[derive(Debug, Clone, Default, Serialize)] #[derive(Clone, Debug, Default, Serialize)]
pub struct AccountConf { pub struct AccountConf {
pub account: AccountSettings, pub account: AccountSettings,
pub conf: FileAccount, pub conf: FileAccount,
@ -573,7 +573,7 @@ This is required so that you don't accidentally start meli and find out later th
} }
} }
#[derive(Debug, Clone, Default, Serialize)] #[derive(Clone, Debug, Default, Serialize)]
pub struct Settings { pub struct Settings {
pub accounts: IndexMap<String, AccountConf>, pub accounts: IndexMap<String, AccountConf>,
pub pager: PagerSettings, pub pager: PagerSettings,
@ -646,7 +646,7 @@ impl Settings {
} }
} }
#[derive(Copy, Debug, Clone, Hash, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum IndexStyle { pub enum IndexStyle {
Plain, Plain,
Threaded, Threaded,
@ -786,7 +786,7 @@ impl Serialize for IndexStyle {
} }
} }
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum SearchBackend { pub enum SearchBackend {
None, None,
#[default] #[default]
@ -1001,7 +1001,7 @@ mod pp {
} }
} }
#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct LogSettings { pub struct LogSettings {
#[serde(default)] #[serde(default)]

@ -30,7 +30,7 @@ use super::{
}; };
/// Settings for writing and sending new e-mail /// Settings for writing and sending new e-mail
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct ComposingSettings { pub struct ComposingSettings {
/// A command to pipe new emails to /// A command to pipe new emails to
@ -176,7 +176,7 @@ pub mod strings {
named_unit_variant!(server_submission); named_unit_variant!(server_submission);
} }
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub enum SendMail { pub enum SendMail {
#[cfg(feature = "smtp")] #[cfg(feature = "smtp")]
@ -188,7 +188,7 @@ pub enum SendMail {
/// Shell command compose hooks (See /// Shell command compose hooks (See
/// [`crate::mail::compose::hooks::Hook`]) /// [`crate::mail::compose::hooks::Hook`])
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct ComposeHook { pub struct ComposeHook {
#[serde(deserialize_with = "non_empty_string")] #[serde(deserialize_with = "non_empty_string")]

@ -55,7 +55,7 @@ use super::{default_vals::*, DotAddressable, IndexStyle};
/// const HAS_SIBLING_LEAF: &str = " ├─"; /// const HAS_SIBLING_LEAF: &str = " ├─";
/// const NO_SIBLING_LEAF: &str = " ╰─"; /// const NO_SIBLING_LEAF: &str = " ╰─";
/// ``` /// ```
#[derive(Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct ListingSettings { pub struct ListingSettings {
/// Number of context lines when going to next page. /// Number of context lines when going to next page.

@ -27,7 +27,7 @@ use super::{
}; };
/// Settings for the notifications function. /// Settings for the notifications function.
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct NotificationsSettings { pub struct NotificationsSettings {
/// Enable notifications. /// Enable notifications.

@ -26,7 +26,7 @@ use melib::{Error, Result, ToggleFlag};
use super::{default_vals::*, deserializers::*, DotAddressable}; use super::{default_vals::*, deserializers::*, DotAddressable};
/// Settings for the pager function. /// Settings for the pager function.
#[derive(Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct PagerSettings { pub struct PagerSettings {
/// Number of context lines when going to next page. /// Number of context lines when going to next page.

@ -24,7 +24,7 @@ use melib::conf::ToggleFlag;
use super::default_vals::*; use super::default_vals::*;
/// Settings for digital signing and encryption /// Settings for digital signing and encryption
#[derive(Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct PGPSettings { pub struct PGPSettings {
/// auto verify signed e-mail according to RFC3156 /// auto verify signed e-mail according to RFC3156

@ -35,7 +35,7 @@ macro_rules! shortcut {
}; };
} }
#[derive(Default, Debug, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct Shortcuts { pub struct Shortcuts {
#[serde(default)] #[serde(default)]

@ -29,7 +29,7 @@ use serde::{Deserialize, Deserializer};
use super::DotAddressable; use super::DotAddressable;
use crate::terminal::Color; use crate::terminal::Color;
#[derive(Default, Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct TagsSettings { pub struct TagsSettings {
#[serde(default, deserialize_with = "tag_color_de")] #[serde(default, deserialize_with = "tag_color_de")]

@ -26,7 +26,7 @@ use melib::{Error, Result, ToggleFlag};
use super::{deserializers::non_empty_opt_string, DotAddressable, Themes}; use super::{deserializers::non_empty_opt_string, DotAddressable, Themes};
/// Settings for terminal display /// Settings for terminal display
#[derive(Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(default, deny_unknown_fields)] #[serde(default, deny_unknown_fields)]
pub struct TerminalSettings { pub struct TerminalSettings {
/// light, dark /// light, dark
@ -109,7 +109,7 @@ impl DotAddressable for TerminalSettings {
} }
} }
#[derive(Debug, Deserialize, Clone, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub enum ProgressSpinnerSequence { pub enum ProgressSpinnerSequence {
Integer(usize), Integer(usize),

@ -323,7 +323,7 @@ const DEFAULT_KEYS: &[&str] = &[
]; ];
/// `ThemeAttributeInner` but with the links resolved. /// `ThemeAttributeInner` but with the links resolved.
#[derive(Debug, PartialEq, Eq, Clone, Default, Copy, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct ThemeAttribute { pub struct ThemeAttribute {
pub fg: Color, pub fg: Color,
@ -332,7 +332,7 @@ pub struct ThemeAttribute {
} }
/// Holds {fore,back}ground color and terminal attribute values. /// Holds {fore,back}ground color and terminal attribute values.
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct ThemeAttributeInner { pub struct ThemeAttributeInner {
#[serde(default)] #[serde(default)]
@ -353,7 +353,7 @@ impl Default for ThemeAttributeInner {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub enum ColorField { pub enum ColorField {
// Like self, i.e. either Fg or Bg // Like self, i.e. either Fg or Bg
LikeSelf, LikeSelf,
@ -376,7 +376,7 @@ impl ThemeLink for Attr {
type LinkType = (); type LinkType = ();
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
/// Holds either an actual value or refers to the key name of the attribute that /// Holds either an actual value or refers to the key name of the attribute that
/// holds the value. /// holds the value.
enum ThemeValue<T: ThemeLink> { enum ThemeValue<T: ThemeLink> {
@ -501,14 +501,14 @@ impl<'de> Deserialize<'de> for ThemeValue<Color> {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Themes { pub struct Themes {
pub light: Theme, pub light: Theme,
pub dark: Theme, pub dark: Theme,
pub other_themes: IndexMap<String, Theme>, pub other_themes: IndexMap<String, Theme>,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Theme { pub struct Theme {
color_aliases: IndexMap<Cow<'static, str>, ThemeValue<Color>>, color_aliases: IndexMap<Cow<'static, str>, ThemeValue<Color>>,
attr_aliases: IndexMap<Cow<'static, str>, ThemeValue<Attr>>, attr_aliases: IndexMap<Cow<'static, str>, ThemeValue<Attr>>,
@ -533,7 +533,7 @@ mod regexp {
#[derive(Clone)] #[derive(Clone)]
pub struct RegexpWrapper(pub pcre2::bytes::Regex); pub struct RegexpWrapper(pub pcre2::bytes::Regex);
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub(super) struct TextFormatterSetting { pub(super) struct TextFormatterSetting {
pub(super) regexp: RegexpWrapper, pub(super) regexp: RegexpWrapper,
pub(super) fg: Option<ThemeValue<Color>>, pub(super) fg: Option<ThemeValue<Color>>,
@ -542,7 +542,7 @@ mod regexp {
pub(super) priority: u8, pub(super) priority: u8,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct TextFormatter<'r> { pub struct TextFormatter<'r> {
pub regexp: &'r RegexpWrapper, pub regexp: &'r RegexpWrapper,
pub tag: FormatTag, pub tag: FormatTag,
@ -784,7 +784,7 @@ impl<'de> Deserialize<'de> for Themes {
#[serde(flatten, default)] #[serde(flatten, default)]
other_themes: IndexMap<String, ThemeOptions>, other_themes: IndexMap<String, ThemeOptions>,
} }
#[derive(Deserialize, Default)] #[derive(Default, Deserialize)]
struct ThemeOptions { struct ThemeOptions {
#[serde(default)] #[serde(default)]
color_aliases: IndexMap<Cow<'static, str>, ThemeValue<Color>>, color_aliases: IndexMap<Cow<'static, str>, ThemeValue<Color>>,
@ -797,7 +797,7 @@ impl<'de> Deserialize<'de> for Themes {
keys: IndexMap<Cow<'static, str>, ThemeAttributeInnerOptions>, keys: IndexMap<Cow<'static, str>, ThemeAttributeInnerOptions>,
} }
#[cfg(feature = "regexp")] #[cfg(feature = "regexp")]
#[derive(Deserialize, Default)] #[derive(Default, Deserialize)]
struct RegexpOptions { struct RegexpOptions {
#[serde(default = "false_val")] #[serde(default = "false_val")]
caseless: bool, caseless: bool,
@ -816,7 +816,7 @@ impl<'de> Deserialize<'de> for Themes {
#[serde(flatten)] #[serde(flatten)]
rest: ThemeAttributeInnerOptions, rest: ThemeAttributeInnerOptions,
} }
#[derive(Deserialize, Default)] #[derive(Default, Deserialize)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
struct ThemeAttributeInnerOptions { struct ThemeAttributeInnerOptions {
#[serde(default)] #[serde(default)]
@ -1815,7 +1815,7 @@ impl Serialize for Themes {
/* Check Theme linked values for cycles */ /* Check Theme linked values for cycles */
fn is_cyclic(theme: &Theme) -> std::result::Result<(), String> { fn is_cyclic(theme: &Theme) -> std::result::Result<(), String> {
#[derive(Hash, Copy, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Eq, Hash, PartialEq)]
enum Course { enum Course {
Fg, Fg,
Bg, Bg,

@ -110,7 +110,7 @@ pub struct MeliTask {
timer: bool, timer: bool,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
/// A spawned future's metadata for book-keeping. /// A spawned future's metadata for book-keeping.
pub struct JobMetadata { pub struct JobMetadata {
pub id: JobId, pub id: JobId,

@ -32,7 +32,7 @@ use crate::{
}, },
}; };
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)] #[repr(u8)]
enum Column { enum Column {
_0 = 0, _0 = 0,

@ -47,7 +47,7 @@ use edit_attachments::*;
pub mod hooks; pub mod hooks;
#[derive(Debug, PartialEq, Eq)] #[derive(Debug, Eq, PartialEq)]
enum Cursor { enum Cursor {
Headers, Headers,
Body, Body,

@ -21,7 +21,7 @@
use super::*; use super::*;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum EditAttachmentCursor { pub enum EditAttachmentCursor {
AttachmentNo(usize), AttachmentNo(usize),
#[default] #[default]

@ -247,7 +247,7 @@ impl Component for KeySelection {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct GpgComposeState { pub struct GpgComposeState {
pub sign_mail: ToggleFlag, pub sign_mail: ToggleFlag,
pub encrypt_mail: ToggleFlag, pub encrypt_mail: ToggleFlag,

@ -245,14 +245,14 @@ pub use self::plain::*;
mod offline; mod offline;
pub use self::offline::*; pub use self::offline::*;
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub enum Focus { pub enum Focus {
None, None,
Entry, Entry,
EntryFullscreen, EntryFullscreen,
} }
#[derive(Debug, Copy, PartialEq, Eq, Clone, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum Modifier { pub enum Modifier {
#[default] #[default]
SymmetricDifference, SymmetricDifference,
@ -469,7 +469,7 @@ column_str!(struct SubjectString(String));
column_str!(struct FlagString(String)); column_str!(struct FlagString(String));
column_str!(struct TagString(String, SmallVec<[Option<Color>; 8]>)); column_str!(struct TagString(String, SmallVec<[Option<Color>; 8]>));
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
struct MailboxMenuEntry { struct MailboxMenuEntry {
depth: usize, depth: usize,
indentation: u32, indentation: u32,
@ -953,19 +953,19 @@ impl ListingComponent {
} }
} }
#[derive(PartialEq, Eq, Debug)] #[derive(Debug, Eq, PartialEq)]
enum ListingFocus { enum ListingFocus {
Menu, Menu,
Mailbox, Mailbox,
} }
#[derive(PartialEq, Eq, Copy, Clone, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
struct CursorPos { struct CursorPos {
account: usize, account: usize,
menu: MenuEntryCursor, menu: MenuEntryCursor,
} }
#[derive(PartialEq, Eq, Copy, Clone, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum MenuEntryCursor { enum MenuEntryCursor {
Status, Status,
Mailbox(usize), Mailbox(usize),
@ -983,7 +983,7 @@ impl std::ops::Sub<MenuEntryCursor> for isize {
} }
} }
#[derive(PartialEq, Eq, Copy, Clone, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum ShowMenuScrollbar { enum ShowMenuScrollbar {
Never, Never,
True, True,
@ -2637,7 +2637,7 @@ impl Listing {
/// Print a single account in the menu area. /// Print a single account in the menu area.
fn print_account(&mut self, mut area: Area, aidx: usize, context: &mut Context) -> usize { fn print_account(&mut self, mut area: Area, aidx: usize, context: &mut Context) -> usize {
let account_y = self.menu.area().height() - area.height(); let account_y = self.menu.area().height() - area.height();
#[derive(Copy, Debug, Clone)] #[derive(Clone, Copy, Debug)]
struct Line { struct Line {
collapsed: bool, collapsed: bool,
depth: usize, depth: usize,
@ -3158,7 +3158,7 @@ impl Listing {
} }
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum ListingMessage { pub enum ListingMessage {
FocusUpdate { FocusUpdate {
new_value: Focus, new_value: Focus,

@ -24,7 +24,7 @@ use melib::{text_processing::Truncate, Envelope, Error, Mail, Result};
use super::{EnvelopeView, MailView, ViewSettings}; use super::{EnvelopeView, MailView, ViewSettings};
use crate::{jobs::JoinHandle, mailbox_settings, Component, Context, ShortcutMaps, UIEvent}; use crate::{jobs::JoinHandle, mailbox_settings, Component, Context, ShortcutMaps, UIEvent};
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
pub enum PendingReplyAction { pub enum PendingReplyAction {
Reply, Reply,
ReplyToAuthor, ReplyToAuthor,

@ -43,7 +43,7 @@ struct ThreadEntry {
mailview: Box<MailView>, mailview: Box<MailView>,
} }
#[derive(Debug, Default, Copy, Clone)] #[derive(Clone, Copy, Debug, Default)]
pub enum ThreadViewFocus { pub enum ThreadViewFocus {
#[default] #[default]
None, None,

@ -29,7 +29,7 @@ use crate::{
ShortcutMap, ThemeAttribute, UIDialog, ShortcutMap, ThemeAttribute, UIDialog,
}; };
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct ViewSettings { pub struct ViewSettings {
pub pager_filter: Option<String>, pub pager_filter: Option<String>,
pub html_filter: Option<String>, pub html_filter: Option<String>,
@ -67,13 +67,13 @@ impl Default for ViewSettings {
} }
} }
#[derive(Eq, PartialEq, Copy, Clone, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum LinkKind { pub enum LinkKind {
Url, Url,
Email, Email,
} }
#[derive(Eq, PartialEq, Clone, Debug)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct Link { pub struct Link {
pub start: usize, pub start: usize,
pub end: usize, pub end: usize,
@ -98,7 +98,7 @@ impl From<&ForceCharset> for Option<Charset> {
} }
} }
#[derive(PartialEq, Eq, Copy, Clone, Debug)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Source { pub enum Source {
Decoded, Decoded,
Raw, Raw,

@ -26,7 +26,7 @@ use melib::{backends::AccountHash, SortOrder};
use super::*; use super::*;
use crate::{accounts::MailboxEntry, melib::text_processing::TextProcessing}; use crate::{accounts::MailboxEntry, melib::text_processing::TextProcessing};
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum MailboxAction { enum MailboxAction {
Rename, Rename,
Move, Move,
@ -41,7 +41,7 @@ enum ViewMode {
Action(UIDialog<MailboxAction>), Action(UIDialog<MailboxAction>),
} }
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)] #[repr(u8)]
enum Column { enum Column {
_0 = 0, _0 = 0,

@ -176,7 +176,7 @@ mod dbus {
} }
/// Passes notifications to a user defined shell command /// Passes notifications to a user defined shell command
#[derive(Default, Debug)] #[derive(Debug, Default)]
pub struct NotificationCommand { pub struct NotificationCommand {
id: ComponentId, id: ComponentId,
} }

@ -110,7 +110,7 @@ impl InputHandler {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct MainLoopHandler { pub struct MainLoopHandler {
pub sender: Sender<ThreadEvent>, pub sender: Sender<ThreadEvent>,
pub job_executor: Arc<JobExecutor>, pub job_executor: Arc<JobExecutor>,

@ -43,7 +43,7 @@ use crate::{state::Context, ThemeAttribute};
/// ///
/// See `CellBuffer::scroll_up` and `CellBuffer::scroll_down` for an explanation /// See `CellBuffer::scroll_up` and `CellBuffer::scroll_down` for an explanation
/// of how `xterm` scrolling works. /// of how `xterm` scrolling works.
#[derive(Debug, Clone, PartialEq, Eq, Default)] #[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct ScrollRegion { pub struct ScrollRegion {
pub top: usize, pub top: usize,
pub bottom: usize, pub bottom: usize,
@ -59,7 +59,7 @@ pub struct ScrollRegion {
/// The first index, `Cellbuffer[y]`, corresponds to a row, and thus the y-axis. /// The first index, `Cellbuffer[y]`, corresponds to a row, and thus the y-axis.
/// The second index, `Cellbuffer[y][x]`, corresponds to a column within a row /// The second index, `Cellbuffer[y][x]`, corresponds to a column within a row
/// and thus the x-axis. /// and thus the x-axis.
#[derive(Clone, PartialEq, Eq)] #[derive(Clone, Eq, PartialEq)]
pub struct CellBuffer { pub struct CellBuffer {
pub cols: usize, pub cols: usize,
pub rows: usize, pub rows: usize,
@ -806,7 +806,7 @@ impl std::fmt::Display for CellBuffer {
/// A single point on a terminal display. /// A single point on a terminal display.
/// ///
/// A `Cell` contains a character and style. /// A `Cell` contains a character and style.
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Cell { pub struct Cell {
ch: char, ch: char,
@ -1777,7 +1777,7 @@ impl KMP for CellBuffer {
} }
} }
#[derive(Debug, Default, Copy, Hash, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct FormatTag { pub struct FormatTag {
pub fg: Option<Color>, pub fg: Option<Color>,
pub bg: Option<Color>, pub bg: Option<Color>,
@ -1817,7 +1817,7 @@ impl FormatTag {
} }
} }
#[derive(Debug, Copy, Hash, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum WidgetWidth { pub enum WidgetWidth {
Unset, Unset,
Hold(usize), Hold(usize),

@ -49,7 +49,7 @@ use termion::color::{AnsiValue, Rgb as TermionRgb};
/// // Basic colors are also 8-bit colors (but not vice-versa). /// // Basic colors are also 8-bit colors (but not vice-versa).
/// assert_eq!(red.as_byte(), fancy.as_byte()) /// assert_eq!(red.as_byte(), fancy.as_byte())
/// ``` /// ```
#[derive(Hash, Debug, Copy, Clone, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum Color { pub enum Color {
Black, Black,
Red, Red,
@ -447,7 +447,7 @@ impl<'de> Deserialize<'de> for Color {
#[test] #[test]
fn test_color_de() { fn test_color_de() {
#[derive(Debug, Deserialize, PartialEq, Eq)] #[derive(Debug, Deserialize, Eq, PartialEq)]
struct V { struct V {
k: Color, k: Color,
} }

@ -21,7 +21,7 @@
use smallvec::SmallVec; use smallvec::SmallVec;
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub enum State { pub enum State {
ExpectingControlChar, ExpectingControlChar,
G0, // Designate G0 Character Set G0, // Designate G0 Character Set

@ -52,7 +52,7 @@ use crate::terminal::{
Area, Color, Screen, Virtual, Area, Color, Screen, Virtual,
}; };
#[derive(Debug, Default, Clone, Copy)] #[derive(Clone, Copy, Debug, Default)]
#[repr(u8)] #[repr(u8)]
pub enum ScreenBuffer { pub enum ScreenBuffer {
#[default] #[default]
@ -60,7 +60,7 @@ pub enum ScreenBuffer {
Alternate, Alternate,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum CodepointBuf { enum CodepointBuf {
None, None,
TwoCodepoints(u8), TwoCodepoints(u8),
@ -184,7 +184,7 @@ impl Terminal {
/// translated as changes to the grid, eg changes in a cell's colors. /// translated as changes to the grid, eg changes in a cell's colors.
/// ///
/// The main process copies the grid whenever the actual terminal is redrawn. /// The main process copies the grid whenever the actual terminal is redrawn.
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct EmbeddedGrid { pub struct EmbeddedGrid {
cursor: (usize, usize), cursor: (usize, usize),
/// `[top;bottom]` /// `[top;bottom]`

@ -34,7 +34,7 @@ use termion::{
use super::*; use super::*;
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum Key { pub enum Key {
/// Backspace. /// Backspace.
Backspace, Backspace,
@ -80,7 +80,7 @@ pub enum Key {
} }
/// A mouse related event. /// A mouse related event.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub enum MouseEvent { pub enum MouseEvent {
/// A mouse button was pressed. /// A mouse button was pressed.
@ -109,7 +109,7 @@ impl From<TermionMouseEvent> for MouseEvent {
} }
/// A mouse button. /// A mouse button.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(untagged)] #[serde(untagged)]
pub enum MouseButton { pub enum MouseButton {
/// The left mouse button. /// The left mouse button.
@ -208,7 +208,7 @@ impl PartialEq<Key> for &Key {
} }
} }
#[derive(PartialEq, Eq)] #[derive(Eq, PartialEq)]
/// Keep track of whether we're accepting normal user input or a pasted string. /// Keep track of whether we're accepting normal user input or a pasted string.
enum InputMode { enum InputMode {
Normal, Normal,
@ -426,7 +426,7 @@ impl Serialize for Key {
#[test] #[test]
fn test_key_serde() { fn test_key_serde() {
#[derive(Debug, Deserialize, PartialEq, Eq)] #[derive(Debug, Deserialize, Eq, PartialEq)]
struct V { struct V {
k: Key, k: Key,
} }

@ -52,7 +52,7 @@ pub fn pos_dec(p: Pos, dec: (usize, usize)) -> Pos {
(p.0.saturating_sub(dec.0), p.1.saturating_sub(dec.1)) (p.0.saturating_sub(dec.0), p.1.saturating_sub(dec.1))
} }
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum Alignment { pub enum Alignment {
/// Stretch to fill all space if possible, center if no meaningful way to /// Stretch to fill all space if possible, center if no meaningful way to
/// stretch. /// stretch.

@ -40,7 +40,7 @@ pub type StateStdout = termion::screen::AlternateScreen<
type DrawHorizontalSegmentFn = fn(&mut CellBuffer, &mut StateStdout, usize, usize, usize) -> (); type DrawHorizontalSegmentFn = fn(&mut CellBuffer, &mut StateStdout, usize, usize, usize) -> ();
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)] #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(transparent)] #[repr(transparent)]
pub struct ScreenGeneration((u64, u64)); pub struct ScreenGeneration((u64, u64));
@ -478,7 +478,7 @@ impl Screen<Virtual> {
} }
/// An `Area` consists of two points: the upper left and bottom right corners. /// An `Area` consists of two points: the upper left and bottom right corners.
#[derive(Clone, Copy, Eq, PartialEq, Hash)] #[derive(Clone, Copy, Eq, Hash, PartialEq)]
pub struct Area { pub struct Area {
offset: Pos, offset: Pos,
upper_left: Pos, upper_left: Pos,

@ -21,7 +21,7 @@
use melib::text_processing::TextProcessing; use melib::text_processing::TextProcessing;
#[derive(Debug, Clone, Default, PartialEq, Eq)] #[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct UText { pub struct UText {
content: String, content: String,
cursor_pos: usize, cursor_pos: usize,

@ -105,7 +105,7 @@ pub enum ForkType {
NewDraft(File, std::process::Child), NewDraft(File, std::process::Child),
} }
#[derive(Debug, PartialEq, Eq, Copy, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NotificationType { pub enum NotificationType {
Info, Info,
Error(melib::error::ErrorKind), Error(melib::error::ErrorKind),
@ -191,7 +191,7 @@ impl From<RefreshEvent> for UIEvent {
} }
} }
#[derive(Debug, PartialEq, Eq, Copy, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum UIMode { pub enum UIMode {
Normal, Normal,
Insert, Insert,
@ -226,7 +226,7 @@ pub mod segment_tree {
use smallvec::SmallVec; use smallvec::SmallVec;
#[derive(Default, Debug, Clone)] #[derive(Clone, Debug, Default)]
pub struct SegmentTree { pub struct SegmentTree {
pub array: SmallVec<[u8; 1024]>, pub array: SmallVec<[u8; 1024]>,
tree: SmallVec<[u8; 1024]>, tree: SmallVec<[u8; 1024]>,

@ -51,7 +51,7 @@ use indexmap::IndexMap;
pub use self::tables::*; pub use self::tables::*;
use crate::{components::ExtendShortcutsMaps, jobs::JobId, melib::text_processing::TextProcessing}; use crate::{components::ExtendShortcutsMaps, jobs::JobId, melib::text_processing::TextProcessing};
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum SearchMovement { pub enum SearchMovement {
Previous, Previous,
#[default] #[default]
@ -60,7 +60,7 @@ pub enum SearchMovement {
Last, Last,
} }
#[derive(Default, Debug, Clone)] #[derive(Clone, Debug, Default)]
pub struct SearchPattern { pub struct SearchPattern {
pattern: String, pattern: String,
positions: Vec<(usize, usize)>, positions: Vec<(usize, usize)>,

@ -25,7 +25,7 @@ const OK: &str = "OK";
const CANCEL: &str = "Cancel"; const CANCEL: &str = "Cancel";
const CANCEL_OFFSET: usize = "OK ".len(); const CANCEL_OFFSET: usize = "OK ".len();
#[derive(Debug, Copy, PartialEq, Eq, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum SelectorCursor { enum SelectorCursor {
Unfocused, Unfocused,
/// Cursor is at an entry /// Cursor is at an entry

@ -28,7 +28,7 @@ use crate::terminal::embedded::EmbeddedGrid;
/// `Pager` holds its own content in its own `CellBuffer` and when `draw` is /// `Pager` holds its own content in its own `CellBuffer` and when `draw` is
/// called, it draws the current view of the text. It is responsible for /// called, it draws the current view of the text. It is responsible for
/// scrolling etc. /// scrolling etc.
#[derive(Default, Debug, Clone)] #[derive(Clone, Debug, Default)]
pub struct Pager { pub struct Pager {
text: String, text: String,
cursor: (usize, usize), cursor: (usize, usize),

@ -28,7 +28,7 @@ use crate::{
terminal::{Screen, Virtual}, terminal::{Screen, Virtual},
}; };
#[derive(Debug, Default, Copy, Clone)] #[derive(Clone, Copy, Debug, Default)]
pub enum ColumnElasticity { pub enum ColumnElasticity {
#[default] #[default]
Rigid, Rigid,
@ -65,7 +65,7 @@ impl TableRowFormat {
} }
*/ */
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct TableThemeConfig { pub struct TableThemeConfig {
pub theme: TableTheme, pub theme: TableTheme,
//pub row_formats: HashMap<usize, SmallVec<[(u8, TableRowFormat); 6]>>, //pub row_formats: HashMap<usize, SmallVec<[(u8, TableRowFormat); 6]>>,
@ -83,7 +83,7 @@ impl TableThemeConfig {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub enum TableTheme { pub enum TableTheme {
Single(ThemeAttribute), Single(ThemeAttribute),
EvenOdd { EvenOdd {
@ -98,7 +98,7 @@ impl Default for TableTheme {
} }
} }
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct TableCursorConfig { pub struct TableCursorConfig {
pub handle: bool, pub handle: bool,
pub theme: TableTheme, pub theme: TableTheme,
@ -121,7 +121,7 @@ impl TableCursorConfig {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct DataColumns<const N: usize> { pub struct DataColumns<const N: usize> {
pub cursor_config: TableCursorConfig, pub cursor_config: TableCursorConfig,
pub theme_config: TableThemeConfig, pub theme_config: TableThemeConfig,

@ -24,7 +24,7 @@ use std::{borrow::Cow, collections::HashMap, time::Duration};
use super::*; use super::*;
use crate::melib::text_processing::TextProcessing; use crate::melib::text_processing::TextProcessing;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
enum FormFocus { enum FormFocus {
#[default] #[default]
Fields, Fields,
@ -194,7 +194,7 @@ impl std::fmt::Display for Field {
} }
} }
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum FormButtonActions { pub enum FormButtonActions {
Accept, Accept,
Reset, Reset,
@ -662,7 +662,7 @@ where
} }
} }
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct AutoCompleteEntry { pub struct AutoCompleteEntry {
pub entry: String, pub entry: String,
pub description: String, pub description: String,
@ -703,7 +703,7 @@ impl From<(String, String)> for AutoCompleteEntry {
} }
} }
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct AutoComplete { pub struct AutoComplete {
entries: Vec<AutoCompleteEntry>, entries: Vec<AutoCompleteEntry>,
cursor: usize, cursor: usize,
@ -872,7 +872,7 @@ impl AutoComplete {
} }
} }
#[derive(Default, Copy, Clone)] #[derive(Clone, Copy, Default)]
pub struct ScrollBar { pub struct ScrollBar {
pub show_arrows: bool, pub show_arrows: bool,
} }

@ -32,7 +32,7 @@ use crate::utils::{
parsec::Parser, parsec::Parser,
}; };
#[derive(Hash, Debug, PartialEq, Eq, Clone, Copy, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(from = "String")] #[serde(from = "String")]
#[serde(into = "String")] #[serde(into = "String")]
pub enum CardId { pub enum CardId {
@ -75,7 +75,7 @@ impl From<String> for CardId {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct AddressBook { pub struct AddressBook {
display_name: String, display_name: String,
created: UnixTimestamp, created: UnixTimestamp,
@ -83,7 +83,7 @@ pub struct AddressBook {
pub cards: HashMap<CardId, Card>, pub cards: HashMap<CardId, Card>,
} }
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Card { pub struct Card {
id: CardId, id: CardId,
title: String, title: String,

@ -76,7 +76,7 @@ impl<V: VCardVersion> VCard<V> {
} }
} }
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct ContentLine { pub struct ContentLine {
group: Option<String>, group: Option<String>,
params: Vec<String>, params: Vec<String>,

@ -246,7 +246,7 @@ impl Backends {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub enum BackendEvent { pub enum BackendEvent {
Notice { Notice {
description: String, description: String,
@ -270,7 +270,7 @@ impl From<Error> for BackendEvent {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub enum RefreshEventKind { pub enum RefreshEventKind {
Update(EnvelopeHash, Box<Envelope>), Update(EnvelopeHash, Box<Envelope>),
/// Rename(old_hash, new_hash) /// Rename(old_hash, new_hash)
@ -290,7 +290,7 @@ pub enum RefreshEventKind {
MailboxUnsubscribe(MailboxHash), MailboxUnsubscribe(MailboxHash),
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct RefreshEvent { pub struct RefreshEvent {
pub mailbox_hash: MailboxHash, pub mailbox_hash: MailboxHash,
pub account_hash: AccountHash, pub account_hash: AccountHash,
@ -320,7 +320,7 @@ impl Deref for BackendEventConsumer {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum FlagOp { pub enum FlagOp {
Set(Flag), Set(Flag),
SetTag(String), SetTag(String),
@ -351,7 +351,7 @@ impl FlagOp {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct MailBackendCapabilities { pub struct MailBackendCapabilities {
pub is_async: bool, pub is_async: bool,
pub is_remote: bool, pub is_remote: bool,
@ -362,7 +362,7 @@ pub struct MailBackendCapabilities {
pub extra_submission_headers: &'static [HeaderName], pub extra_submission_headers: &'static [HeaderName],
} }
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub enum MailBackendExtensionStatus { pub enum MailBackendExtensionStatus {
Unsupported { comment: Option<&'static str> }, Unsupported { comment: Option<&'static str> },
Supported { comment: Option<&'static str> }, Supported { comment: Option<&'static str> },
@ -524,7 +524,7 @@ impl BackendOp for ReadOnlyOp {
} }
} }
#[derive(Default, Debug, Copy, Hash, Eq, Clone, Serialize, Deserialize, PartialEq)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum SpecialUsageMailbox { pub enum SpecialUsageMailbox {
#[default] #[default]
Normal, Normal,
@ -606,7 +606,7 @@ impl Clone for Mailbox {
} }
} }
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct MailboxPermissions { pub struct MailboxPermissions {
pub create_messages: bool, pub create_messages: bool,
pub remove_messages: bool, pub remove_messages: bool,
@ -639,7 +639,7 @@ impl std::fmt::Display for MailboxPermissions {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct EnvelopeHashBatch { pub struct EnvelopeHashBatch {
pub first: EnvelopeHash, pub first: EnvelopeHash,
pub rest: SmallVec<[EnvelopeHash; 64]>, pub rest: SmallVec<[EnvelopeHash; 64]>,
@ -692,7 +692,7 @@ impl EnvelopeHashBatch {
} }
} }
#[derive(Default, Clone)] #[derive(Clone, Default)]
pub struct LazyCountSet { pub struct LazyCountSet {
pub not_yet_seen: usize, pub not_yet_seen: usize,
pub set: BTreeSet<EnvelopeHash>, pub set: BTreeSet<EnvelopeHash>,

@ -33,7 +33,7 @@ use crate::backends::{MailboxHash, TagHash};
pub type EnvelopeRef<'g> = RwRef<'g, EnvelopeHash, Envelope>; pub type EnvelopeRef<'g> = RwRef<'g, EnvelopeHash, Envelope>;
pub type EnvelopeRefMut<'g> = RwRefMut<'g, EnvelopeHash, Envelope>; pub type EnvelopeRefMut<'g> = RwRefMut<'g, EnvelopeHash, Envelope>;
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Collection { pub struct Collection {
pub envelopes: Arc<RwLock<HashMap<EnvelopeHash, Envelope>>>, pub envelopes: Arc<RwLock<HashMap<EnvelopeHash, Envelope>>>,
pub message_id_index: Arc<RwLock<HashMap<Vec<u8>, EnvelopeHash>>>, pub message_id_index: Arc<RwLock<HashMap<Vec<u8>, EnvelopeHash>>>,

@ -32,7 +32,7 @@ use crate::{
}; };
pub use crate::{SortField, SortOrder}; pub use crate::{SortField, SortOrder};
#[derive(Debug, Serialize, Default, Clone)] #[derive(Clone, Debug, Default, Serialize)]
pub struct AccountSettings { pub struct AccountSettings {
pub name: String, pub name: String,
pub root_mailbox: String, pub root_mailbox: String,
@ -102,7 +102,7 @@ impl AccountSettings {
} }
} }
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(default)] #[serde(default)]
pub struct MailboxConf { pub struct MailboxConf {
#[serde(alias = "rename")] #[serde(alias = "rename")]
@ -187,7 +187,7 @@ pub mod strings {
named_unit_variant!(ask); named_unit_variant!(ask);
} }
#[derive(Copy, Default, Debug, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum ToggleFlag { pub enum ToggleFlag {
#[default] #[default]
Unset, Unset,

@ -223,7 +223,7 @@ impl Flag {
/// the raw bytes that describe the email in `bytes`. Its body as an /// the raw bytes that describe the email in `bytes`. Its body as an
/// `melib::email::Attachment` can be parsed on demand /// `melib::email::Attachment` can be parsed on demand
/// with the `melib::email::Mail::body` method. /// with the `melib::email::Mail::body` method.
#[derive(Debug, Clone, Default)] #[derive(Clone, Debug, Default)]
pub struct Mail { pub struct Mail {
pub envelope: Envelope, pub envelope: Envelope,
pub bytes: Vec<u8>, pub bytes: Vec<u8>,
@ -267,7 +267,7 @@ crate::declare_u64_hash!(EnvelopeHash);
/// ///
///To access the email attachments, you need to parse them from the raw email ///To access the email attachments, you need to parse them from the raw email
/// bytes into an `Attachment` object. /// bytes into an `Attachment` object.
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Deserialize, Serialize)]
pub struct Envelope { pub struct Envelope {
// ----- IMAP4rev1 ----- // ----- IMAP4rev1 -----
pub date: String, pub date: String,

@ -29,14 +29,14 @@ use std::{
use super::*; use super::*;
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GroupAddress { pub struct GroupAddress {
pub raw: Vec<u8>, pub raw: Vec<u8>,
pub display_name: StrBuilder, pub display_name: StrBuilder,
pub mailbox_list: Vec<Address>, pub mailbox_list: Vec<Address>,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
/** /**
* Container for an address. * Container for an address.
* *
@ -100,7 +100,7 @@ impl PartialEq for MailboxAddress {
/// assert_eq!(addr.get_display_name(), Some("Jörg Doe".to_string())); /// assert_eq!(addr.get_display_name(), Some("Jörg Doe".to_string()));
/// assert_eq!(addr.get_email(), "joerg@example.com".to_string()); /// assert_eq!(addr.get_email(), "joerg@example.com".to_string());
/// ``` /// ```
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Deserialize, Serialize)]
pub enum Address { pub enum Address {
Mailbox(MailboxAddress), Mailbox(MailboxAddress),
Group(GroupAddress), Group(GroupAddress),
@ -467,7 +467,7 @@ impl TryFrom<&str> for Address {
} }
} }
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
#[repr(transparent)] #[repr(transparent)]
pub struct UIAddress<'a>(&'a Address); pub struct UIAddress<'a>(&'a Address);
@ -495,7 +495,7 @@ impl std::fmt::Display for UIAddress<'_> {
} }
} }
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
#[repr(transparent)] #[repr(transparent)]
pub struct UINameAddress<'a>(&'a Address); pub struct UINameAddress<'a>(&'a Address);
@ -521,7 +521,7 @@ impl std::fmt::Display for UINameAddress<'_> {
} }
/// Helper struct to return slices from a struct field on demand. /// Helper struct to return slices from a struct field on demand.
#[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq, Eq, Copy, Hash)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct StrBuilder { pub struct StrBuilder {
pub offset: usize, pub offset: usize,
pub length: usize, pub length: usize,
@ -550,7 +550,7 @@ impl StrBuilder {
} }
/// `MessageID` is accessed through the `StrBuild` trait. /// `MessageID` is accessed through the `StrBuild` trait.
#[derive(Clone, Serialize, Deserialize, Default)] #[derive(Clone, Default, Deserialize, Serialize)]
pub struct MessageID(pub Vec<u8>, pub StrBuilder); pub struct MessageID(pub Vec<u8>, pub StrBuilder);
impl StrBuild for MessageID { impl StrBuild for MessageID {
@ -617,7 +617,7 @@ impl std::fmt::Debug for MessageID {
} }
} }
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Deserialize, Serialize)]
pub struct References { pub struct References {
pub raw: Vec<u8>, pub raw: Vec<u8>,
pub refs: Vec<MessageID>, pub refs: Vec<MessageID>,

@ -25,7 +25,7 @@ use crate::email::{
parser::BytesExt, parser::BytesExt,
}; };
#[derive(Clone, Default, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum Charset { pub enum Charset {
Ascii, Ascii,
#[default] #[default]
@ -194,7 +194,7 @@ impl std::fmt::Display for Charset {
} }
} }
#[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum MultipartType { pub enum MultipartType {
Alternative, Alternative,
Digest, Digest,
@ -242,7 +242,7 @@ impl From<&[u8]> for MultipartType {
} }
} }
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum ContentType { pub enum ContentType {
Text { Text {
kind: Text, kind: Text,
@ -438,7 +438,7 @@ impl ContentType {
} }
} }
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum Text { pub enum Text {
Plain, Plain,
Html, Html,
@ -463,7 +463,7 @@ impl std::fmt::Display for Text {
} }
} }
#[derive(Clone, Default, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum ContentTransferEncoding { pub enum ContentTransferEncoding {
#[default] #[default]
_8Bit, _8Bit,
@ -506,7 +506,7 @@ impl From<&[u8]> for ContentTransferEncoding {
} }
} }
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct ContentDisposition { pub struct ContentDisposition {
pub kind: ContentDispositionKind, pub kind: ContentDispositionKind,
pub filename: Option<String>, pub filename: Option<String>,
@ -517,7 +517,7 @@ pub struct ContentDisposition {
pub parameter: Vec<String>, pub parameter: Vec<String>,
} }
#[derive(Clone, Default, Debug, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum ContentDispositionKind { pub enum ContentDispositionKind {
#[default] #[default]
Inline, Inline,

@ -59,7 +59,7 @@ impl<'att> From<Option<Charset>> for DecodeOptions<'att> {
} }
} }
#[derive(Default, Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
/// A struct analogous to [`Attachment`] which can have incomplete and partial /// A struct analogous to [`Attachment`] which can have incomplete and partial
/// content before being turned into an [`Attachment`] with /// content before being turned into an [`Attachment`] with
/// [`AttachmentBuilder::build`]. /// [`AttachmentBuilder::build`].
@ -387,7 +387,7 @@ impl From<AttachmentBuilder> for Attachment {
} }
/// Immutable attachment type. /// Immutable attachment type.
#[derive(Clone, Serialize, Deserialize, PartialEq, Hash, Eq)] #[derive(Clone, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct Attachment { pub struct Attachment {
pub content_type: ContentType, pub content_type: ContentType,
pub content_transfer_encoding: ContentTransferEncoding, pub content_transfer_encoding: ContentTransferEncoding,

@ -44,7 +44,7 @@ pub mod random;
use super::parser; use super::parser;
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct Draft { pub struct Draft {
pub headers: HeaderMap, pub headers: HeaderMap,
pub body: String, pub body: String,

@ -82,7 +82,7 @@ impl<'a> Borrow<dyn HeaderKey + 'a> for HeaderName {
/// ///
/// Except for the above, indexing will also panic if index is out of range or /// Except for the above, indexing will also panic if index is out of range or
/// header key is not present in the map. /// header key is not present in the map.
#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct HeaderMap(indexmap::IndexMap<HeaderName, String>); pub struct HeaderMap(indexmap::IndexMap<HeaderName, String>);
impl std::ops::Index<usize> for HeaderMap { impl std::ops::Index<usize> for HeaderMap {

@ -50,7 +50,7 @@ bitflags! {
/// Case insensitive owned wrapper for a header name. /// Case insensitive owned wrapper for a header name.
/// As of `RFC5322` it's guaranteed to be ASCII. /// As of `RFC5322` it's guaranteed to be ASCII.
#[derive(Debug, Clone, Eq, PartialEq, Hash)] #[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct HeaderName { pub struct HeaderName {
pub(super) inner: Repr<Custom>, pub(super) inner: Repr<Custom>,
} }
@ -62,7 +62,7 @@ impl Custom {
} }
} }
#[derive(Debug, Clone, Eq, PartialEq, Hash)] #[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub(super) enum Repr<T> { pub(super) enum Repr<T> {
Standard(StandardHeader), Standard(StandardHeader),
Custom(T), Custom(T),
@ -78,7 +78,7 @@ impl<T: std::fmt::Display> std::fmt::Display for Repr<T> {
} }
// Used to hijack the Hash impl // Used to hijack the Hash impl
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub(super) struct Custom(pub(super) SmallVec<[u8; 32]>); pub(super) struct Custom(pub(super) SmallVec<[u8; 32]>);
/// A possible error when converting a `HeaderName` from another type. /// A possible error when converting a `HeaderName` from another type.
@ -225,7 +225,7 @@ impl<'de> Deserialize<'de> for HeaderName {
where where
D: Deserializer<'de>, D: Deserializer<'de>,
{ {
#[derive(Serialize, Deserialize)] #[derive(Deserialize, Serialize)]
#[serde(untagged)] #[serde(untagged)]
enum Helper { enum Helper {
S(String), S(String),

@ -209,7 +209,7 @@ standards! {
} }
/// Status of field at the moment of writing. /// Status of field at the moment of writing.
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum Status { pub enum Status {
/// Deprecated, /// Deprecated,
Deprecated, Deprecated,

@ -27,7 +27,7 @@ use smallvec::SmallVec;
use super::{parser, Envelope}; use super::{parser, Envelope};
#[derive(Debug, PartialEq, Eq, Clone, Copy)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ListAction<'a> { pub enum ListAction<'a> {
Url(&'a [u8]), Url(&'a [u8]),
Email(&'a [u8]), Email(&'a [u8]),
@ -75,7 +75,7 @@ impl<'a> ListAction<'a> {
} }
} }
#[derive(Default, Debug)] #[derive(Debug, Default)]
pub struct ListActions<'a> { pub struct ListActions<'a> {
pub id: Option<&'a str>, pub id: Option<&'a str>,
pub archive: Option<&'a str>, pub archive: Option<&'a str>,

@ -32,7 +32,7 @@ use crate::{
utils::percent_encoding::{AsciiSet, CONTROLS}, utils::percent_encoding::{AsciiSet, CONTROLS},
}; };
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct Mailto { pub struct Mailto {
pub address: Vec<Address>, pub address: Vec<Address>,
pub body: Option<String>, pub body: Option<String>,

@ -140,7 +140,7 @@ pub fn verify_signature(a: &Attachment) -> Result<(Vec<u8>, &Attachment)> {
} }
} }
#[derive(Debug, Clone, Default)] #[derive(Clone, Debug, Default)]
pub struct DecryptionMetadata { pub struct DecryptionMetadata {
pub recipients: Vec<Recipient>, pub recipients: Vec<Recipient>,
pub file_name: Option<String>, pub file_name: Option<String>,
@ -148,13 +148,13 @@ pub struct DecryptionMetadata {
pub is_mime: bool, pub is_mime: bool,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Recipient { pub struct Recipient {
pub keyid: Option<String>, pub keyid: Option<String>,
pub status: Result<()>, pub status: Result<()>,
} }
#[derive(Debug, Clone, Default)] #[derive(Clone, Debug, Default)]
pub struct SignatureMetadata { pub struct SignatureMetadata {
pub signatures: Vec<Recipient>, pub signatures: Vec<Recipient>,
pub file_name: Option<String>, pub file_name: Option<String>,

@ -25,7 +25,7 @@ use std::{borrow::Cow, io, result, str, string, sync::Arc};
pub type Result<T> = result::Result<T, Error>; pub type Result<T> = result::Result<T, Error>;
#[derive(Debug, Copy, PartialEq, Eq, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum NetworkErrorKind { pub enum NetworkErrorKind {
/// Unspecified /// Unspecified
None, None,
@ -316,7 +316,7 @@ impl From<isahc::http::StatusCode> for NetworkErrorKind {
} }
} }
#[derive(Debug, Copy, PartialEq, Eq, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive] #[non_exhaustive]
pub enum ErrorKind { pub enum ErrorKind {
None, None,
@ -389,7 +389,7 @@ impl ErrorKind {
is_variant! { is_value_error, ValueError } is_variant! { is_value_error, ValueError }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Error { pub struct Error {
pub summary: Cow<'static, str>, pub summary: Cow<'static, str>,
pub details: Option<Cow<'static, str>>, pub details: Option<Cow<'static, str>>,

@ -32,7 +32,7 @@ use libc::{off_t, time_t, FILE};
/* automatically generated by rust-bindgen */ /* automatically generated by rust-bindgen */
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] #[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage, Align> { pub struct __BindgenBitfieldUnit<Storage, Align> {
storage: Storage, storage: Storage,
align: [Align; 0], align: [Align; 0],
@ -184,13 +184,13 @@ pub type gpg_err_code_from_syserror = extern "C" fn() -> gpg_err_code_t;
pub type gpg_error_check_version = pub type gpg_error_check_version =
extern "C" fn(req_version: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char; extern "C" fn(req_version: *const ::std::os::raw::c_char) -> *const ::std::os::raw::c_char;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_context { pub struct gpgme_context {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type gpgme_ctx_t = *mut gpgme_context; pub type gpgme_ctx_t = *mut gpgme_context;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_data { pub struct gpgme_data {
_unused: [u8; 0], _unused: [u8; 0],
} }
@ -307,7 +307,7 @@ pub type gpgme_pinentry_mode_t = u32;
pub type gpgme_export_mode_t = ::std::os::raw::c_uint; pub type gpgme_export_mode_t = ::std::os::raw::c_uint;
pub type gpgme_sig_notation_flags_t = ::std::os::raw::c_uint; pub type gpgme_sig_notation_flags_t = ::std::os::raw::c_uint;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_sig_notation { pub struct _gpgme_sig_notation {
pub next: *mut _gpgme_sig_notation, pub next: *mut _gpgme_sig_notation,
pub name: *mut ::std::os::raw::c_char, pub name: *mut ::std::os::raw::c_char,
@ -450,7 +450,7 @@ impl _gpgme_sig_notation {
} }
pub type gpgme_sig_notation_t = *mut _gpgme_sig_notation; pub type gpgme_sig_notation_t = *mut _gpgme_sig_notation;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_engine_info { pub struct _gpgme_engine_info {
pub next: *mut _gpgme_engine_info, pub next: *mut _gpgme_engine_info,
pub protocol: gpgme_protocol_t, pub protocol: gpgme_protocol_t,
@ -535,7 +535,7 @@ fn bindgen_test_layout__gpgme_engine_info() {
} }
pub type gpgme_engine_info_t = *mut _gpgme_engine_info; pub type gpgme_engine_info_t = *mut _gpgme_engine_info;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_tofu_info { pub struct _gpgme_tofu_info {
pub next: *mut _gpgme_tofu_info, pub next: *mut _gpgme_tofu_info,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -700,7 +700,7 @@ impl _gpgme_tofu_info {
} }
pub type gpgme_tofu_info_t = *mut _gpgme_tofu_info; pub type gpgme_tofu_info_t = *mut _gpgme_tofu_info;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_subkey { pub struct _gpgme_subkey {
pub next: *mut _gpgme_subkey, pub next: *mut _gpgme_subkey,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -1058,7 +1058,7 @@ impl _gpgme_subkey {
} }
pub type gpgme_subkey_t = *mut _gpgme_subkey; pub type gpgme_subkey_t = *mut _gpgme_subkey;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_key_sig { pub struct _gpgme_key_sig {
pub next: *mut _gpgme_key_sig, pub next: *mut _gpgme_key_sig,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -1332,7 +1332,7 @@ impl _gpgme_key_sig {
} }
pub type gpgme_key_sig_t = *mut _gpgme_key_sig; pub type gpgme_key_sig_t = *mut _gpgme_key_sig;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_user_id { pub struct _gpgme_user_id {
pub next: *mut _gpgme_user_id, pub next: *mut _gpgme_user_id,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -1546,7 +1546,7 @@ impl _gpgme_user_id {
} }
pub type gpgme_user_id_t = *mut _gpgme_user_id; pub type gpgme_user_id_t = *mut _gpgme_user_id;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_key { pub struct _gpgme_key {
pub _refs: ::std::os::raw::c_uint, pub _refs: ::std::os::raw::c_uint,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -1910,7 +1910,7 @@ impl _gpgme_key {
} }
pub type gpgme_key_t = *mut _gpgme_key; pub type gpgme_key_t = *mut _gpgme_key;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_invalid_key { pub struct _gpgme_invalid_key {
pub next: *mut _gpgme_invalid_key, pub next: *mut _gpgme_invalid_key,
pub fpr: *mut ::std::os::raw::c_char, pub fpr: *mut ::std::os::raw::c_char,
@ -2107,7 +2107,7 @@ pub const gpgme_event_io_t_GPGME_EVENT_NEXT_KEY: gpgme_event_io_t = 2;
pub const gpgme_event_io_t_GPGME_EVENT_NEXT_TRUSTITEM: gpgme_event_io_t = 3; pub const gpgme_event_io_t_GPGME_EVENT_NEXT_TRUSTITEM: gpgme_event_io_t = 3;
pub type gpgme_event_io_t = u32; pub type gpgme_event_io_t = u32;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_io_event_done_data { pub struct gpgme_io_event_done_data {
pub err: gpgme_error_t, pub err: gpgme_error_t,
pub op_err: gpgme_error_t, pub op_err: gpgme_error_t,
@ -2155,7 +2155,7 @@ pub type gpgme_event_io_cb_t = ::std::option::Option<
), ),
>; >;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_io_cbs { pub struct gpgme_io_cbs {
pub add: gpgme_register_io_cb_t, pub add: gpgme_register_io_cb_t,
pub add_priv: *mut ::std::os::raw::c_void, pub add_priv: *mut ::std::os::raw::c_void,
@ -2282,7 +2282,7 @@ pub type gpgme_data_seek_cb_t = ::std::option::Option<
pub type gpgme_data_release_cb_t = pub type gpgme_data_release_cb_t =
::std::option::Option<unsafe extern "C" fn(handle: *mut ::std::os::raw::c_void)>; ::std::option::Option<unsafe extern "C" fn(handle: *mut ::std::os::raw::c_void)>;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_data_cbs { pub struct gpgme_data_cbs {
pub read: gpgme_data_read_cb_t, pub read: gpgme_data_read_cb_t,
pub write: gpgme_data_write_cb_t, pub write: gpgme_data_write_cb_t,
@ -2415,7 +2415,7 @@ pub type gpgme_key_from_uid =
pub type gpgme_key_ref = unsafe extern "C" fn(key: gpgme_key_t); pub type gpgme_key_ref = unsafe extern "C" fn(key: gpgme_key_t);
pub type gpgme_key_unref = unsafe extern "C" fn(key: gpgme_key_t); pub type gpgme_key_unref = unsafe extern "C" fn(key: gpgme_key_t);
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_encrypt_result { pub struct _gpgme_op_encrypt_result {
pub invalid_recipients: gpgme_invalid_key_t, pub invalid_recipients: gpgme_invalid_key_t,
} }
@ -2519,7 +2519,7 @@ pub type gpgme_op_encrypt_sign_ext = extern "C" fn(
cipher: gpgme_data_t, cipher: gpgme_data_t,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_recipient { pub struct _gpgme_recipient {
pub next: *mut _gpgme_recipient, pub next: *mut _gpgme_recipient,
pub keyid: *mut ::std::os::raw::c_char, pub keyid: *mut ::std::os::raw::c_char,
@ -2593,7 +2593,7 @@ fn bindgen_test_layout__gpgme_recipient() {
} }
pub type gpgme_recipient_t = *mut _gpgme_recipient; pub type gpgme_recipient_t = *mut _gpgme_recipient;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_decrypt_result { pub struct _gpgme_op_decrypt_result {
pub unsupported_algorithm: *mut ::std::os::raw::c_char, pub unsupported_algorithm: *mut ::std::os::raw::c_char,
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
@ -2795,7 +2795,7 @@ pub type gpgme_op_decrypt_ext = extern "C" fn(
plain: gpgme_data_t, plain: gpgme_data_t,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_new_signature { pub struct _gpgme_new_signature {
pub next: *mut _gpgme_new_signature, pub next: *mut _gpgme_new_signature,
pub type_: gpgme_sig_mode_t, pub type_: gpgme_sig_mode_t,
@ -2917,7 +2917,7 @@ fn bindgen_test_layout__gpgme_new_signature() {
} }
pub type gpgme_new_signature_t = *mut _gpgme_new_signature; pub type gpgme_new_signature_t = *mut _gpgme_new_signature;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_sign_result { pub struct _gpgme_op_sign_result {
pub invalid_signers: gpgme_invalid_key_t, pub invalid_signers: gpgme_invalid_key_t,
pub signatures: gpgme_new_signature_t, pub signatures: gpgme_new_signature_t,
@ -2988,7 +2988,7 @@ pub const gpgme_sigsum_t_GPGME_SIGSUM_SYS_ERROR: gpgme_sigsum_t = 2048;
pub const gpgme_sigsum_t_GPGME_SIGSUM_TOFU_CONFLICT: gpgme_sigsum_t = 4096; pub const gpgme_sigsum_t_GPGME_SIGSUM_TOFU_CONFLICT: gpgme_sigsum_t = 4096;
pub type gpgme_sigsum_t = u32; pub type gpgme_sigsum_t = u32;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_signature { pub struct _gpgme_signature {
pub next: *mut _gpgme_signature, pub next: *mut _gpgme_signature,
pub summary: gpgme_sigsum_t, pub summary: gpgme_sigsum_t,
@ -3242,7 +3242,7 @@ impl _gpgme_signature {
} }
pub type gpgme_signature_t = *mut _gpgme_signature; pub type gpgme_signature_t = *mut _gpgme_signature;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_verify_result { pub struct _gpgme_op_verify_result {
pub signatures: gpgme_signature_t, pub signatures: gpgme_signature_t,
pub file_name: *mut ::std::os::raw::c_char, pub file_name: *mut ::std::os::raw::c_char,
@ -3343,7 +3343,7 @@ pub type gpgme_op_verify = extern "C" fn(
plaintext: gpgme_data_t, plaintext: gpgme_data_t,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_import_status { pub struct _gpgme_import_status {
pub next: *mut _gpgme_import_status, pub next: *mut _gpgme_import_status,
pub fpr: *mut ::std::os::raw::c_char, pub fpr: *mut ::std::os::raw::c_char,
@ -3406,7 +3406,7 @@ fn bindgen_test_layout__gpgme_import_status() {
} }
pub type gpgme_import_status_t = *mut _gpgme_import_status; pub type gpgme_import_status_t = *mut _gpgme_import_status;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_import_result { pub struct _gpgme_op_import_result {
pub considered: ::std::os::raw::c_int, pub considered: ::std::os::raw::c_int,
pub no_user_id: ::std::os::raw::c_int, pub no_user_id: ::std::os::raw::c_int,
@ -3677,7 +3677,7 @@ pub type gpgme_op_export_keys = extern "C" fn(
keydata: gpgme_data_t, keydata: gpgme_data_t,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_genkey_result { pub struct _gpgme_op_genkey_result {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
pub fpr: *mut ::std::os::raw::c_char, pub fpr: *mut ::std::os::raw::c_char,
@ -3943,7 +3943,7 @@ pub type gpgme_op_tofu_policy =
extern "C" fn(ctx: gpgme_ctx_t, key: gpgme_key_t, policy: gpgme_tofu_policy_t) -> gpgme_error_t; extern "C" fn(ctx: gpgme_ctx_t, key: gpgme_key_t, policy: gpgme_tofu_policy_t) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[repr(align(4))] #[repr(align(4))]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_keylist_result { pub struct _gpgme_op_keylist_result {
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
} }
@ -4033,7 +4033,7 @@ pub type gpgme_op_passwd = extern "C" fn(
flags: ::std::os::raw::c_uint, flags: ::std::os::raw::c_uint,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_trust_item { pub struct _gpgme_trust_item {
pub _refs: ::std::os::raw::c_uint, pub _refs: ::std::os::raw::c_uint,
pub keyid: *mut ::std::os::raw::c_char, pub keyid: *mut ::std::os::raw::c_char,
@ -4243,7 +4243,7 @@ pub type gpgme_op_assuan_transact_ext = extern "C" fn(
op_err: *mut gpgme_error_t, op_err: *mut gpgme_error_t,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_vfs_mount_result { pub struct _gpgme_op_vfs_mount_result {
pub mount_dir: *mut ::std::os::raw::c_char, pub mount_dir: *mut ::std::os::raw::c_char,
} }
@ -4307,14 +4307,14 @@ pub const gpgme_conf_type_t_GPGME_CONF_SEC_KEY: gpgme_conf_type_t = 36;
pub const gpgme_conf_type_t_GPGME_CONF_ALIAS_LIST: gpgme_conf_type_t = 37; pub const gpgme_conf_type_t_GPGME_CONF_ALIAS_LIST: gpgme_conf_type_t = 37;
pub type gpgme_conf_type_t = u32; pub type gpgme_conf_type_t = u32;
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub struct gpgme_conf_arg { pub struct gpgme_conf_arg {
pub next: *mut gpgme_conf_arg, pub next: *mut gpgme_conf_arg,
pub no_arg: ::std::os::raw::c_uint, pub no_arg: ::std::os::raw::c_uint,
pub value: gpgme_conf_arg__bindgen_ty_1, pub value: gpgme_conf_arg__bindgen_ty_1,
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub union gpgme_conf_arg__bindgen_ty_1 { pub union gpgme_conf_arg__bindgen_ty_1 {
pub count: ::std::os::raw::c_uint, pub count: ::std::os::raw::c_uint,
pub uint32: ::std::os::raw::c_uint, pub uint32: ::std::os::raw::c_uint,
@ -4430,7 +4430,7 @@ fn bindgen_test_layout_gpgme_conf_arg() {
} }
pub type gpgme_conf_arg_t = *mut gpgme_conf_arg; pub type gpgme_conf_arg_t = *mut gpgme_conf_arg;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_conf_opt { pub struct gpgme_conf_opt {
pub next: *mut gpgme_conf_opt, pub next: *mut gpgme_conf_opt,
pub name: *mut ::std::os::raw::c_char, pub name: *mut ::std::os::raw::c_char,
@ -4629,7 +4629,7 @@ fn bindgen_test_layout_gpgme_conf_opt() {
} }
pub type gpgme_conf_opt_t = *mut gpgme_conf_opt; pub type gpgme_conf_opt_t = *mut gpgme_conf_opt;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct gpgme_conf_comp { pub struct gpgme_conf_comp {
pub next: *mut gpgme_conf_comp, pub next: *mut gpgme_conf_comp,
pub _last_opt_p: *mut gpgme_conf_opt_t, pub _last_opt_p: *mut gpgme_conf_opt_t,
@ -4735,7 +4735,7 @@ pub type gpgme_op_conf_dir = extern "C" fn(
result: *mut *mut ::std::os::raw::c_char, result: *mut *mut ::std::os::raw::c_char,
) -> gpgme_error_t; ) -> gpgme_error_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_query_swdb_result { pub struct _gpgme_op_query_swdb_result {
pub next: *mut _gpgme_op_query_swdb_result, pub next: *mut _gpgme_op_query_swdb_result,
pub name: *mut ::std::os::raw::c_char, pub name: *mut ::std::os::raw::c_char,
@ -5283,7 +5283,7 @@ pub type gpgme_trust_item_get_int_attr = extern "C" fn(
idx: ::std::os::raw::c_int, idx: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _gpgme_op_assuan_result { pub struct _gpgme_op_assuan_result {
pub err: gpgme_error_t, pub err: gpgme_error_t,
} }
@ -5359,7 +5359,7 @@ pub type GpgmeTrustItem = gpgme_trust_item_t;
pub use self::gpgme_status_code_t as GpgmeStatusCode; pub use self::gpgme_status_code_t as GpgmeStatusCode;
pub type __builtin_va_list = [__va_list_tag; 1usize]; pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct __va_list_tag { pub struct __va_list_tag {
pub gp_offset: ::std::os::raw::c_uint, pub gp_offset: ::std::os::raw::c_uint,
pub fp_offset: ::std::os::raw::c_uint, pub fp_offset: ::std::os::raw::c_uint,

@ -76,7 +76,7 @@ pub mod bindings;
use bindings::*; use bindings::*;
pub mod io; pub mod io;
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum GpgmeFlag { pub enum GpgmeFlag {
///"auto-key-retrieve" ///"auto-key-retrieve"
AutoKeyRetrieve, AutoKeyRetrieve,

@ -29,7 +29,7 @@ use crate::{
error::*, error::*,
}; };
#[derive(Debug, PartialEq, Hash, Eq, Ord, PartialOrd, Copy, Clone)] #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ModSequence(pub std::num::NonZeroU64); pub struct ModSequence(pub std::num::NonZeroU64);
impl TryFrom<i64> for ModSequence { impl TryFrom<i64> for ModSequence {

@ -77,7 +77,7 @@ macro_rules! imap_trace {
use super::{protocol_parser, Capabilities, ImapServerConf, UIDStore}; use super::{protocol_parser, Capabilities, ImapServerConf, UIDStore};
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum SyncPolicy { pub enum SyncPolicy {
None, None,
/// RFC4549 `Synch Ops for Disconnected IMAP4 Clients` <https://tools.ietf.org/html/rfc4549> /// RFC4549 `Synch Ops for Disconnected IMAP4 Clients` <https://tools.ietf.org/html/rfc4549>
@ -88,13 +88,13 @@ pub enum SyncPolicy {
CondstoreQresync, CondstoreQresync,
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum ImapProtocol { pub enum ImapProtocol {
IMAP { extension_use: ImapExtensionUse }, IMAP { extension_use: ImapExtensionUse },
ManageSieve, ManageSieve,
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub struct ImapExtensionUse { pub struct ImapExtensionUse {
pub condstore: bool, pub condstore: bool,
pub idle: bool, pub idle: bool,
@ -124,7 +124,7 @@ pub struct ImapStream {
pub timeout: Option<Duration>, pub timeout: Option<Duration>,
} }
#[derive(Debug, Copy, Clone, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MailboxSelection { pub enum MailboxSelection {
None, None,
Select(MailboxHash), Select(MailboxHash),

@ -29,7 +29,7 @@ use crate::{
error::*, error::*,
}; };
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct ImapMailbox { pub struct ImapMailbox {
pub hash: MailboxHash, pub hash: MailboxHash,
pub imap_path: String, pub imap_path: String,

@ -38,7 +38,7 @@ pub struct ManageSieveConnection {
pub inner: ImapConnection, pub inner: ImapConnection,
} }
#[derive(PartialEq, Eq, Debug, Copy, Clone)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ManageSieveResponse<'a> { pub enum ManageSieveResponse<'a> {
Ok { Ok {
code: Option<&'a [u8]>, code: Option<&'a [u8]>,

@ -100,7 +100,7 @@ pub struct EnvelopeCache {
flags: Option<Flag>, flags: Option<Flag>,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct ImapServerConf { pub struct ImapServerConf {
pub server_hostname: String, pub server_hostname: String,
pub server_username: String, pub server_username: String,
@ -1589,7 +1589,7 @@ impl ImapType {
} }
} }
#[derive(Debug, PartialEq, Copy, Clone)] #[derive(Clone, Copy, Debug, PartialEq)]
enum FetchStage { enum FetchStage {
InitialFresh, InitialFresh,
InitialCache, InitialCache,

@ -27,7 +27,7 @@ use super::*;
use crate::{backends::*, error::Error}; use crate::{backends::*, error::Error};
/// `BackendOp` implementor for Imap /// `BackendOp` implementor for Imap
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct ImapOp { pub struct ImapOp {
uid: UID, uid: UID,
mailbox_hash: MailboxHash, mailbox_hash: MailboxHash,

@ -484,7 +484,7 @@ pub fn list_mailbox_result(input: &[u8]) -> IResult<&[u8], ImapMailbox> {
)) ))
} }
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct FetchResponse<'a> { pub struct FetchResponse<'a> {
pub uid: Option<UID>, pub uid: Option<UID>,
pub message_sequence_number: MessageSequenceNumber, pub message_sequence_number: MessageSequenceNumber,
@ -931,7 +931,7 @@ pub fn search_results_raw<'a>(input: &'a [u8]) -> IResult<&'a [u8], &'a [u8]> {
))(input) ))(input)
} }
#[derive(Debug, Default, Eq, PartialEq, Clone)] #[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct SelectResponse { pub struct SelectResponse {
pub exists: ImapNum, pub exists: ImapNum,
pub recent: ImapNum, pub recent: ImapNum,
@ -1382,7 +1382,7 @@ fn eat_whitespace(mut input: &[u8]) -> IResult<&[u8], ()> {
Ok((input, ())) Ok((input, ()))
} }
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct StatusResponse { pub struct StatusResponse {
pub mailbox: Option<MailboxHash>, pub mailbox: Option<MailboxHash>,
pub messages: Option<ImapNum>, pub messages: Option<ImapNum>,

@ -24,7 +24,7 @@ use std::sync::{Arc, Mutex, RwLock};
use super::*; use super::*;
use crate::backends::{LazyCountSet, MailboxPermissions, SpecialUsageMailbox}; use crate::backends::{LazyCountSet, MailboxPermissions, SpecialUsageMailbox};
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct JmapMailbox { pub struct JmapMailbox {
pub name: String, pub name: String,
pub path: String, pub path: String,

@ -115,7 +115,7 @@ pub struct EnvelopeCache {
// flags: Option<Flag>, // flags: Option<Flag>,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct JmapServerConf { pub struct JmapServerConf {
pub server_url: String, pub server_url: String,
pub server_username: String, pub server_username: String,

@ -137,7 +137,7 @@ impl Id<EmailObject> {
// The date the Email was received by the message store. This is the // The date the Email was received by the message store. This is the
// "internal date" in IMAP [RFC3501]./ // "internal date" in IMAP [RFC3501]./
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailObject { pub struct EmailObject {
#[serde(default)] #[serde(default)]
@ -211,7 +211,7 @@ impl EmailObject {
_impl!(get keywords, keywords: IndexMap<String, bool>); _impl!(get keywords, keywords: IndexMap<String, bool>);
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Header { pub struct Header {
pub name: String, pub name: String,
@ -228,7 +228,7 @@ where
Ok(v.into_iter().map(|t| (t.name, t.value)).collect()) Ok(v.into_iter().map(|t| (t.name, t.value)).collect())
} }
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailAddress { pub struct EmailAddress {
pub email: String, pub email: String,
@ -332,7 +332,7 @@ impl std::convert::From<EmailObject> for crate::Envelope {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct HtmlBody { pub struct HtmlBody {
pub blob_id: Id<BlobObject>, pub blob_id: Id<BlobObject>,
@ -359,7 +359,7 @@ pub struct HtmlBody {
pub sub_parts: Vec<Value>, pub sub_parts: Vec<Value>,
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct TextBody { pub struct TextBody {
pub blob_id: Id<BlobObject>, pub blob_id: Id<BlobObject>,
@ -390,7 +390,7 @@ impl Object for EmailObject {
const NAME: &'static str = "Email"; const NAME: &'static str = "Email";
} }
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailQuery { pub struct EmailQuery {
#[serde(flatten)] #[serde(flatten)]
@ -419,7 +419,7 @@ impl EmailQuery {
_impl!(collapse_threads: bool); _impl!(collapse_threads: bool);
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailGet { pub struct EmailGet {
#[serde(flatten)] #[serde(flatten)]
@ -461,7 +461,7 @@ impl EmailGet {
_impl!(max_body_value_bytes: u64); _impl!(max_body_value_bytes: u64);
} }
#[derive(Serialize, Deserialize, Default, Debug)] #[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailFilterCondition { pub struct EmailFilterCondition {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@ -546,7 +546,7 @@ impl From<EmailFilterCondition> for FilterCondition<EmailFilterCondition, EmailO
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum MessageProperty { pub enum MessageProperty {
ThreadId, ThreadId,
@ -790,7 +790,7 @@ fn test_jmap_query() {
assert_eq!(*request_no.lock().unwrap(), 1); assert_eq!(*request_no.lock().unwrap(), 1);
} }
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailSet { pub struct EmailSet {
#[serde(flatten)] #[serde(flatten)]
@ -807,7 +807,7 @@ impl EmailSet {
} }
} }
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailChanges { pub struct EmailChanges {
#[serde(flatten)] #[serde(flatten)]
@ -824,7 +824,7 @@ impl EmailChanges {
} }
} }
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailQueryChanges { pub struct EmailQueryChanges {
#[serde(flatten)] #[serde(flatten)]
@ -843,7 +843,7 @@ impl EmailQueryChanges {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
pub struct EmailQueryChangesResponse { pub struct EmailQueryChangesResponse {
///o The "collapseThreads" argument that was used with "Email/query". ///o The "collapseThreads" argument that was used with "Email/query".
#[serde(default = "bool_false")] #[serde(default = "bool_false")]

@ -33,7 +33,7 @@ use super::*;
/// - `account_id`: `Id` /// - `account_id`: `Id`
/// ///
/// The id of the account to use. /// The id of the account to use.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailImport { pub struct EmailImport {
/// accountId: `Id` /// accountId: `Id`
@ -52,7 +52,7 @@ pub struct EmailImport {
pub emails: IndexMap<Id<EmailObject>, EmailImportObject>, pub emails: IndexMap<Id<EmailObject>, EmailImportObject>,
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailImportObject { pub struct EmailImportObject {
/// o blobId: `Id` /// o blobId: `Id`
@ -123,7 +123,7 @@ impl Default for EmailImportObject {
} }
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
#[serde(tag = "type")] #[serde(tag = "type")]
pub enum EmailImportError { pub enum EmailImportError {
@ -164,7 +164,7 @@ pub enum EmailImportError {
StateMismatch, StateMismatch,
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailImportResponse { pub struct EmailImportResponse {
/// o accountId: `Id` /// o accountId: `Id`
@ -205,7 +205,7 @@ impl std::convert::TryFrom<&RawValue> for EmailImportResponse {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailImportResult { pub struct EmailImportResult {
pub id: Id<EmailObject>, pub id: Id<EmailObject>,

@ -25,7 +25,7 @@ use super::*;
/// ///
/// An *Identity* object stores information about an email address or domain the /// An *Identity* object stores information about an email address or domain the
/// user may send from. /// user may send from.
#[derive(Deserialize, Serialize, Debug, Clone, Default)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct IdentityObject { pub struct IdentityObject {
/// id: `Id` (immutable; server-set) /// id: `Id` (immutable; server-set)
@ -107,7 +107,7 @@ impl Method<IdentityObject> for IdentityChanges {
/// o "forbiddenFrom": The user is not allowed to send from the address /// o "forbiddenFrom": The user is not allowed to send from the address
/// given as the "email" property of the Identity. /// given as the "email" property of the Identity.
/// ``` /// ```
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase", transparent)] #[serde(rename_all = "camelCase", transparent)]
pub struct IdentitySet(pub Set<IdentityObject>); pub struct IdentitySet(pub Set<IdentityObject>);

@ -27,7 +27,7 @@ impl Id<MailboxObject> {
} }
} }
#[derive(Deserialize, Serialize, Debug, Default)] #[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MailboxObject { pub struct MailboxObject {
pub id: Id<MailboxObject>, pub id: Id<MailboxObject>,
@ -47,7 +47,7 @@ impl Object for MailboxObject {
const NAME: &'static str = "Mailbox"; const NAME: &'static str = "Mailbox";
} }
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct JmapRights { pub struct JmapRights {
pub may_add_items: bool, pub may_add_items: bool,
@ -77,7 +77,7 @@ impl Default for JmapRights {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MailboxGet { pub struct MailboxGet {
#[serde(flatten)] #[serde(flatten)]
@ -108,7 +108,7 @@ impl Method<MailboxObject> for MailboxGet {
/// ///
/// - `mailboxHasEmail`: The Mailbox has at least one Email assigned to it, and /// - `mailboxHasEmail`: The Mailbox has at least one Email assigned to it, and
/// the `onDestroyRemoveEmails` argument was false. /// the `onDestroyRemoveEmails` argument was false.
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MailboxSet { pub struct MailboxSet {
#[serde(flatten)] #[serde(flatten)]

@ -43,7 +43,7 @@ use super::*;
/// setting this property to `canceled`; if the update succeeds, the /// setting this property to `canceled`; if the update succeeds, the
/// submission was successfully canceled, and the message has not been /// submission was successfully canceled, and the message has not been
/// delivered to any of the original recipients. /// delivered to any of the original recipients.
#[derive(Deserialize, Serialize, Default, Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum UndoStatus { pub enum UndoStatus {
/// It may be possible to cancel this submission. /// It may be possible to cancel this submission.
@ -63,7 +63,7 @@ pub enum UndoStatus {
/// it SHOULD update the EmailSubmission object each time the status /// it SHOULD update the EmailSubmission object each time the status
/// of any of the recipients changes, even if some recipients are /// of any of the recipients changes, even if some recipients are
/// still being retried. /// still being retried.
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct DeliveryStatusObject { pub struct DeliveryStatusObject {
/// The SMTP reply string returned for this recipient when the /// The SMTP reply string returned for this recipient when the
@ -125,7 +125,7 @@ pub struct DeliveryStatusObject {
/// this recipient with Disposition-Type (as per `[RFC8098]`, /// this recipient with Disposition-Type (as per `[RFC8098]`,
/// Section 3.2.6.2) equal to `displayed`, this property SHOULD be /// Section 3.2.6.2) equal to `displayed`, this property SHOULD be
/// set to `yes`. /// set to `yes`.
#[derive(Deserialize, Serialize, Default, Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum Displayed { pub enum Displayed {
/// The recipient's system claims the message content has been displayed to /// The recipient's system claims the message content has been displayed to
@ -153,7 +153,7 @@ pub enum Displayed {
/// ///
/// The server MAY also set this property based on other feedback /// The server MAY also set this property based on other feedback
/// channels. /// channels.
#[derive(Deserialize, Serialize, Default, Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum Delivered { pub enum Delivered {
/// The message is in a local mail queue and the status will change once it /// The message is in a local mail queue and the status will change once it
@ -177,7 +177,7 @@ pub enum Delivered {
/// ///
/// An *EmailSubmission* object represents the submission of an Email for /// An *EmailSubmission* object represents the submission of an Email for
/// delivery to one or more recipients. It has the following properties: /// delivery to one or more recipients. It has the following properties:
#[derive(Deserialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailSubmissionObject { pub struct EmailSubmissionObject {
/// accountId: `Id` /// accountId: `Id`
@ -284,7 +284,7 @@ impl Serialize for EmailSubmissionObject {
} }
} }
#[derive(Serialize, Clone, Debug)] #[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EmailSubmissionSet { pub struct EmailSubmissionSet {
#[serde(flatten)] #[serde(flatten)]
@ -343,7 +343,7 @@ impl EmailSubmissionSet {
} }
/// Information for use when sending via SMTP. /// Information for use when sending via SMTP.
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct EnvelopeObject { pub struct EnvelopeObject {
/// The email address to use as the return address in the SMTP /// The email address to use as the return address in the SMTP
@ -367,7 +367,7 @@ impl Object for EnvelopeObject {
const NAME: &'static str = "Envelope"; const NAME: &'static str = "Envelope";
} }
#[derive(Deserialize, Serialize, Debug, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Address { pub struct Address {
/// The email address being represented by the object. This is a /// The email address being represented by the object. This is a

@ -23,7 +23,7 @@ use std::marker::PhantomData;
use super::*; use super::*;
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ThreadObject { pub struct ThreadObject {
#[serde(default)] #[serde(default)]
@ -40,7 +40,7 @@ impl ThreadObject {
_impl!(get email_ids, email_ids: Vec<Id<EmailObject>>); _impl!(get email_ids, email_ids: Vec<Id<EmailObject>>);
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ThreadGet { pub struct ThreadGet {
#[serde(flatten)] #[serde(flatten)]
@ -63,7 +63,7 @@ impl ThreadGet {
} }
} }
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ThreadChanges { pub struct ThreadChanges {
#[serde(flatten)] #[serde(flatten)]

@ -24,7 +24,7 @@ use std::sync::Arc;
use super::*; use super::*;
/// `BackendOp` implementor for Imap /// `BackendOp` implementor for Imap
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct JmapOp { pub struct JmapOp {
hash: EnvelopeHash, hash: EnvelopeHash,
connection: Arc<FutureMutex<JmapConnection>>, connection: Arc<FutureMutex<JmapConnection>>,

@ -226,7 +226,7 @@ pub async fn get_message(conn: &JmapConnection, ids: &[String]) -> Result<Vec<En
} }
*/ */
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
pub enum EmailFetchState { pub enum EmailFetchState {
Start { batch_size: u64 }, Start { batch_size: u64 },
Ongoing { position: u64, batch_size: u64 }, Ongoing { position: u64, batch_size: u64 },

@ -154,7 +154,7 @@ impl<OBJ> Id<OBJ> {
} }
} }
#[derive(Deserialize, Serialize, Debug)] #[derive(Debug, Deserialize, Serialize)]
#[serde(transparent)] #[serde(transparent)]
pub struct State<OBJ> { pub struct State<OBJ> {
pub inner: String, pub inner: String,
@ -228,7 +228,7 @@ impl<OBJ> State<OBJ> {
} }
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Account { pub struct Account {
pub name: String, pub name: String,
@ -243,14 +243,14 @@ impl Object for Account {
const NAME: &'static str = stringify!(Account); const NAME: &'static str = stringify!(Account);
} }
#[derive(Copy, Clone, Debug)] #[derive(Clone, Copy, Debug)]
pub struct BlobObject; pub struct BlobObject;
impl Object for BlobObject { impl Object for BlobObject {
const NAME: &'static str = "Blob"; const NAME: &'static str = "Blob";
} }
#[derive(Clone, Copy, Deserialize, Serialize, Debug)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct BlobGet; pub struct BlobGet;
@ -267,7 +267,7 @@ impl Method<BlobObject> for BlobGet {
/// - `account_id`: `Id` /// - `account_id`: `Id`
/// ///
/// The id of the account to use. /// The id of the account to use.
#[derive(Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Get<OBJ> pub struct Get<OBJ>
where where
@ -389,7 +389,7 @@ impl<OBJ: Object + Serialize + std::fmt::Debug> Serialize for Get<OBJ> {
} }
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct MethodResponse<'a> { pub struct MethodResponse<'a> {
#[serde(borrow)] #[serde(borrow)]
@ -400,7 +400,7 @@ pub struct MethodResponse<'a> {
pub session_state: State<Session>, pub session_state: State<Session>,
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct GetResponse<OBJ: Object> { pub struct GetResponse<OBJ: Object> {
pub account_id: Id<Account>, pub account_id: Id<Account>,
@ -427,7 +427,7 @@ impl<OBJ: Object> GetResponse<OBJ> {
_impl!(get_mut not_found_mut, not_found: Vec<Id<OBJ>>); _impl!(get_mut not_found_mut, not_found: Vec<Id<OBJ>>);
} }
#[derive(Deserialize, Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
enum JmapError { enum JmapError {
RequestTooLarge, RequestTooLarge,
@ -435,7 +435,7 @@ enum JmapError {
InvalidResultReference, InvalidResultReference,
} }
#[derive(Serialize, Clone, Debug)] #[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Query<F: FilterTrait<OBJ>, OBJ> pub struct Query<F: FilterTrait<OBJ>, OBJ>
where where
@ -508,7 +508,7 @@ pub fn bool_true() -> bool {
true true
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct QueryResponse<OBJ: Object> { pub struct QueryResponse<OBJ: Object> {
pub account_id: Id<Account>, pub account_id: Id<Account>,
@ -578,7 +578,7 @@ impl<M: Method<OBJ>, OBJ: Object> From<&'static str> for ResultField<M, OBJ> {
/// to return. If supplied by the client, the value MUST be a /// to return. If supplied by the client, the value MUST be a
/// positive integer greater than 0. If a value outside of this range /// positive integer greater than 0. If a value outside of this range
/// is given, the server MUST re /// is given, the server MUST re
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
/* ch-ch-ch-ch-ch-Changes */ /* ch-ch-ch-ch-ch-Changes */
pub struct Changes<OBJ> pub struct Changes<OBJ>
@ -640,7 +640,7 @@ where
} }
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct ChangesResponse<OBJ: Object> { pub struct ChangesResponse<OBJ: Object> {
pub account_id: Id<Account>, pub account_id: Id<Account>,
@ -682,7 +682,7 @@ impl<OBJ: Object> ChangesResponse<OBJ> {
/// and dependencies that may exist if doing multiple operations at once /// and dependencies that may exist if doing multiple operations at once
/// (for example, to ensure there is always a minimum number of a certain /// (for example, to ensure there is always a minimum number of a certain
/// record type). /// record type).
#[derive(Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Set<OBJ> pub struct Set<OBJ>
where where
@ -834,7 +834,7 @@ impl<OBJ: Object + Serialize + std::fmt::Debug> Serialize for Set<OBJ> {
} }
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct SetResponse<OBJ: Object> { pub struct SetResponse<OBJ: Object> {
/// o accountId: `Id` /// o accountId: `Id`
@ -905,7 +905,7 @@ impl<OBJ: Object + DeserializeOwned> std::convert::TryFrom<&RawValue> for SetRes
} }
} }
#[derive(Deserialize, Serialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
#[serde(tag = "type", content = "description")] #[serde(tag = "type", content = "description")]
pub enum SetError { pub enum SetError {
@ -1058,7 +1058,7 @@ pub fn upload_request_format(upload_url: &str, account_id: &Id<Account>) -> Stri
ret ret
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct UploadResponse { pub struct UploadResponse {
/// o accountId: `Id` /// o accountId: `Id`
@ -1091,7 +1091,7 @@ pub struct UploadResponse {
/// The `Foo/queryChanges` method allows a client to efficiently update /// The `Foo/queryChanges` method allows a client to efficiently update
/// the state of a cached query to match the new state on the server. It /// the state of a cached query to match the new state on the server. It
/// takes the following arguments: /// takes the following arguments:
#[derive(Serialize, Clone, Debug)] #[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct QueryChanges<F: FilterTrait<OBJ>, OBJ> pub struct QueryChanges<F: FilterTrait<OBJ>, OBJ>
where where
@ -1160,7 +1160,7 @@ where
_impl!(calculate_total: bool); _impl!(calculate_total: bool);
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct QueryChangesResponse<OBJ: Object> { pub struct QueryChangesResponse<OBJ: Object> {
/// The id of the account used for the call. /// The id of the account used for the call.
@ -1241,7 +1241,7 @@ pub struct QueryChangesResponse<OBJ: Object> {
pub added: Vec<AddedItem<OBJ>>, pub added: Vec<AddedItem<OBJ>>,
} }
#[derive(Serialize, Deserialize, Clone, Debug)] #[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct AddedItem<OBJ: Object> { pub struct AddedItem<OBJ: Object> {
pub id: Id<OBJ>, pub id: Id<OBJ>,

@ -26,7 +26,7 @@ use crate::jmap::{
rfc8620::{Object, ResultField}, rfc8620::{Object, ResultField},
}; };
#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Hash, Debug)] #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[serde(rename_all = "camelCase", untagged)] #[serde(rename_all = "camelCase", untagged)]
pub enum Argument<T: Clone + PartialEq + Eq + Hash> { pub enum Argument<T: Clone + PartialEq + Eq + Hash> {
Value(T), Value(T),

@ -21,7 +21,7 @@
use super::*; use super::*;
#[derive(Serialize, Clone, Debug)] #[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Comparator<OBJ: Object> { pub struct Comparator<OBJ: Object> {
property: String, property: String,

@ -22,7 +22,7 @@
use super::*; use super::*;
pub trait FilterTrait<T>: Default {} pub trait FilterTrait<T>: Default {}
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
#[serde(untagged)] #[serde(untagged)]
pub enum Filter<F: FilterTrait<OBJ>, OBJ: Object> { pub enum Filter<F: FilterTrait<OBJ>, OBJ: Object> {
@ -36,7 +36,7 @@ pub enum Filter<F: FilterTrait<OBJ>, OBJ: Object> {
impl<F: FilterTrait<OBJ>, OBJ: Object> FilterTrait<OBJ> for Filter<F, OBJ> {} impl<F: FilterTrait<OBJ>, OBJ: Object> FilterTrait<OBJ> for Filter<F, OBJ> {}
impl<F: FilterTrait<OBJ>, OBJ: Object> FilterTrait<OBJ> for FilterCondition<F, OBJ> {} impl<F: FilterTrait<OBJ>, OBJ: Object> FilterTrait<OBJ> for FilterCondition<F, OBJ> {}
#[derive(Serialize, Debug)] #[derive(Debug, Serialize)]
pub struct FilterCondition<F: FilterTrait<OBJ>, OBJ: Object> { pub struct FilterCondition<F: FilterTrait<OBJ>, OBJ: Object> {
#[serde(flatten)] #[serde(flatten)]
pub cond: F, pub cond: F,
@ -44,7 +44,7 @@ pub struct FilterCondition<F: FilterTrait<OBJ>, OBJ: Object> {
pub _ph: PhantomData<fn() -> OBJ>, pub _ph: PhantomData<fn() -> OBJ>,
} }
#[derive(Serialize, Debug, Eq, PartialEq)] #[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "UPPERCASE")] #[serde(rename_all = "UPPERCASE")]
pub enum FilterOperator { pub enum FilterOperator {
And, And,

@ -29,7 +29,7 @@ use crate::jmap::{
IdentityObject, IdentityObject,
}; };
#[derive(Deserialize, Serialize, Debug, Clone, Default)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Session { pub struct Session {
pub capabilities: IndexMap<String, CapabilitiesObject>, pub capabilities: IndexMap<String, CapabilitiesObject>,
@ -52,7 +52,7 @@ impl Object for Session {
const NAME: &'static str = stringify!(Session); const NAME: &'static str = stringify!(Session);
} }
#[derive(Deserialize, Serialize, Clone, Default, Debug)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct CapabilitiesObject { pub struct CapabilitiesObject {
#[serde(default)] #[serde(default)]

@ -192,7 +192,7 @@ pub extern crate smallvec;
pub extern crate smol; pub extern crate smol;
pub extern crate uuid; pub extern crate uuid;
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
#[repr(transparent)] #[repr(transparent)]
pub struct BytesDisplay(pub usize); pub struct BytesDisplay(pub usize);

@ -114,7 +114,7 @@ impl BackendOp for MaildirOp {
} }
} }
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct MaildirMailbox { pub struct MaildirMailbox {
hash: MailboxHash, hash: MailboxHash,
name: String, name: String,

@ -328,7 +328,7 @@ impl BackendOp for MboxOp {
} }
} }
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum MboxMetadata { pub enum MboxMetadata {
/// Dovecot uses C-Client (ie. UW-IMAP, Pine) compatible headers in mbox /// Dovecot uses C-Client (ie. UW-IMAP, Pine) compatible headers in mbox
/// messages to store me /// messages to store me
@ -347,7 +347,7 @@ pub enum MboxMetadata {
/// Choose between "mboxo", "mboxrd", "mboxcl", "mboxcl2". For new mailboxes, /// Choose between "mboxo", "mboxrd", "mboxcl", "mboxcl2". For new mailboxes,
/// prefer "mboxcl2" which does not alter the mail body. /// prefer "mboxcl2" which does not alter the mail body.
#[derive(Debug, Clone, Copy)] #[derive(Clone, Copy, Debug)]
pub enum MboxFormat { pub enum MboxFormat {
MboxO, MboxO,
MboxRd, MboxRd,

@ -35,7 +35,7 @@ pub use smol::Async as AsyncWrapper;
use super::{Capabilities, NntpServerConf, UIDStore}; use super::{Capabilities, NntpServerConf, UIDStore};
#[derive(Debug, Default, Clone, Copy)] #[derive(Clone, Copy, Debug, Default)]
pub struct NntpExtensionUse { pub struct NntpExtensionUse {
pub deflate: bool, pub deflate: bool,
} }
@ -48,7 +48,7 @@ pub struct NntpStream {
pub supports_submission: bool, pub supports_submission: bool,
} }
#[derive(Debug, Copy, Clone, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MailboxSelection { pub enum MailboxSelection {
None, None,
Select(MailboxHash), Select(MailboxHash),

@ -29,7 +29,7 @@ use crate::{
UnixTimestamp, UnixTimestamp,
}; };
#[derive(Debug, Default, Clone)] #[derive(Clone, Debug, Default)]
pub struct NntpMailbox { pub struct NntpMailbox {
pub(super) hash: MailboxHash, pub(super) hash: MailboxHash,
pub(super) nntp_path: String, pub(super) nntp_path: String,

@ -103,7 +103,7 @@ pub static SUPPORTED_CAPABILITIES: &[&str] = &[
"AUTHINFO USER", "AUTHINFO USER",
]; ];
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct NntpServerConf { pub struct NntpServerConf {
pub server_hostname: String, pub server_hostname: String,
pub server_username: String, pub server_username: String,

@ -25,7 +25,7 @@ use super::*;
use crate::{backends::*, error::Error}; use crate::{backends::*, error::Error};
/// `BackendOp` implementor for Nntp /// `BackendOp` implementor for Nntp
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct NntpOp { pub struct NntpOp {
uid: usize, uid: usize,
mailbox_hash: MailboxHash, mailbox_hash: MailboxHash,

@ -80,67 +80,67 @@ pub use self::_notmuch_status as notmuch_status_t;
pub type notmuch_status_to_string = pub type notmuch_status_to_string =
unsafe extern "C" fn(status: notmuch_status_t) -> *const ::std::os::raw::c_char; unsafe extern "C" fn(status: notmuch_status_t) -> *const ::std::os::raw::c_char;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_database { pub struct _notmuch_database {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_database_t = _notmuch_database; pub type notmuch_database_t = _notmuch_database;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_query { pub struct _notmuch_query {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_query_t = _notmuch_query; pub type notmuch_query_t = _notmuch_query;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_threads { pub struct _notmuch_threads {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_threads_t = _notmuch_threads; pub type notmuch_threads_t = _notmuch_threads;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_thread { pub struct _notmuch_thread {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_thread_t = _notmuch_thread; pub type notmuch_thread_t = _notmuch_thread;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_messages { pub struct _notmuch_messages {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_messages_t = _notmuch_messages; pub type notmuch_messages_t = _notmuch_messages;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_message { pub struct _notmuch_message {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_message_t = _notmuch_message; pub type notmuch_message_t = _notmuch_message;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_tags { pub struct _notmuch_tags {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_tags_t = _notmuch_tags; pub type notmuch_tags_t = _notmuch_tags;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_directory { pub struct _notmuch_directory {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_directory_t = _notmuch_directory; pub type notmuch_directory_t = _notmuch_directory;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_filenames { pub struct _notmuch_filenames {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_filenames_t = _notmuch_filenames; pub type notmuch_filenames_t = _notmuch_filenames;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_config_list { pub struct _notmuch_config_list {
_unused: [u8; 0], _unused: [u8; 0],
} }
pub type notmuch_config_list_t = _notmuch_config_list; pub type notmuch_config_list_t = _notmuch_config_list;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_indexopts { pub struct _notmuch_indexopts {
_unused: [u8; 0], _unused: [u8; 0],
} }
@ -1636,7 +1636,7 @@ pub type notmuch_message_remove_all_properties_with_prefix =
) -> notmuch_status_t; ) -> notmuch_status_t;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Clone, Copy, Debug)]
pub struct _notmuch_string_map_iterator { pub struct _notmuch_string_map_iterator {
_unused: [u8; 0], _unused: [u8; 0],
} }

@ -251,7 +251,7 @@ pub struct NotmuchDb {
unsafe impl Send for NotmuchDb {} unsafe impl Send for NotmuchDb {}
unsafe impl Sync for NotmuchDb {} unsafe impl Sync for NotmuchDb {}
#[derive(Debug, Clone, Default)] #[derive(Clone, Debug, Default)]
struct NotmuchMailbox { struct NotmuchMailbox {
hash: MailboxHash, hash: MailboxHash,
children: Vec<MailboxHash>, children: Vec<MailboxHash>,

@ -29,7 +29,7 @@ use crate::utils::{
parsec::*, parsec::*,
}; };
#[derive(Debug, PartialEq, Clone, Serialize)] #[derive(Clone, Debug, PartialEq, Serialize)]
pub enum Query { pub enum Query {
Before(UnixTimestamp), Before(UnixTimestamp),
After(UnixTimestamp), After(UnixTimestamp),

@ -21,7 +21,7 @@
use crate::utils::parsec::*; use crate::utils::parsec::*;
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct RuleBlock(pub Vec<Rule>); pub struct RuleBlock(pub Vec<Rule>);
/* /*
@ -40,7 +40,7 @@ pub struct RuleBlock(pub Vec<Rule>);
; "eq" means "equal to", the C operator "==". ; "eq" means "equal to", the C operator "==".
; "ne" means "not equal to", the C operator "!=". ; "ne" means "not equal to", the C operator "!=".
*/ */
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum ActionCommand { pub enum ActionCommand {
Keep, Keep,
Fileinto { mailbox: String }, Fileinto { mailbox: String },
@ -48,7 +48,7 @@ pub enum ActionCommand {
Discard, Discard,
} }
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum ControlCommand { pub enum ControlCommand {
Stop, Stop,
Require(Vec<String>), Require(Vec<String>),
@ -59,27 +59,27 @@ pub enum ControlCommand {
}, },
} }
#[derive(Debug, PartialEq, Eq, Clone)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum Rule { pub enum Rule {
Block(RuleBlock), Block(RuleBlock),
Action(ActionCommand), Action(ActionCommand),
Control(ControlCommand), Control(ControlCommand),
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum AddressOperator { pub enum AddressOperator {
All, All,
Localpart, Localpart,
Domain, Domain,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum IntegerOperator { pub enum IntegerOperator {
Over, Over,
Under, Under,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
/// RFC 5231 Sieve Email Filtering: Relational Extension /// RFC 5231 Sieve Email Filtering: Relational Extension
pub enum RelationalMatch { pub enum RelationalMatch {
/// "gt" means "greater than", the C operator ">". /// "gt" means "greater than", the C operator ">".
@ -96,7 +96,7 @@ pub enum RelationalMatch {
Ne, Ne,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum MatchOperator { pub enum MatchOperator {
Is, Is,
Matches, Matches,
@ -105,7 +105,7 @@ pub enum MatchOperator {
Value(RelationalMatch), Value(RelationalMatch),
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CharacterOperator { pub enum CharacterOperator {
/// i;octet, /// i;octet,
Octet, Octet,
@ -113,7 +113,7 @@ pub enum CharacterOperator {
AsciiCasemap, AsciiCasemap,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ZoneRule { pub enum ZoneRule {
/// "year" => the year, "0000" .. "9999". /// "year" => the year, "0000" .. "9999".
Year, Year,
@ -158,7 +158,7 @@ pub enum ZoneRule {
Weekday, Weekday,
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum ConditionRule { pub enum ConditionRule {
/// Logical OR operation. /// Logical OR operation.
AnyOf(Vec<ConditionRule>), AnyOf(Vec<ConditionRule>),

@ -88,7 +88,7 @@ use crate::{
}; };
/// Kind of server security (StartTLS/TLS/None) the client should attempt /// Kind of server security (StartTLS/TLS/None) the client should attempt
#[derive(Debug, Copy, PartialEq, Eq, Clone, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
pub enum SmtpSecurity { pub enum SmtpSecurity {
#[serde(alias = "starttls", alias = "STARTTLS")] #[serde(alias = "starttls", alias = "STARTTLS")]
@ -119,7 +119,7 @@ impl Default for SmtpSecurity {
} }
/// Source of user's password for SMTP authentication /// Source of user's password for SMTP authentication
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(tag = "type", content = "value")] #[serde(tag = "type", content = "value")]
pub enum Password { pub enum Password {
#[serde(alias = "raw")] #[serde(alias = "raw")]
@ -129,7 +129,7 @@ pub enum Password {
} }
/// Kind of server authentication the client should attempt /// Kind of server authentication the client should attempt
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(tag = "type")] #[serde(tag = "type")]
pub enum SmtpAuth { pub enum SmtpAuth {
#[serde(alias = "none")] #[serde(alias = "none")]
@ -152,7 +152,7 @@ pub enum SmtpAuth {
// md5, sasl, etc // md5, sasl, etc
} }
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Default)] #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub struct SmtpAuthType { pub struct SmtpAuthType {
plain: bool, plain: bool,
login: bool, login: bool,
@ -169,7 +169,7 @@ impl SmtpAuth {
} }
/// Server configuration for connecting the SMTP client /// Server configuration for connecting the SMTP client
#[derive(Debug, Serialize, Deserialize, Clone)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SmtpServerConf { pub struct SmtpServerConf {
pub hostname: String, pub hostname: String,
pub port: u16, pub port: u16,
@ -184,7 +184,7 @@ pub struct SmtpServerConf {
//example: "SIZE 52428800", "8BITMIME", "PIPELINING", "CHUNKING", "PRDR", //example: "SIZE 52428800", "8BITMIME", "PIPELINING", "CHUNKING", "PRDR",
/// Configured SMTP extensions to use /// Configured SMTP extensions to use
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct SmtpExtensionSupport { pub struct SmtpExtensionSupport {
#[serde(default = "crate::conf::true_val")] #[serde(default = "crate::conf::true_val")]
pipelining: bool, pipelining: bool,
@ -826,7 +826,7 @@ impl SmtpConnection {
pub type ExpectedReplyCode = Option<(ReplyCode, &'static [ReplyCode])>; pub type ExpectedReplyCode = Option<(ReplyCode, &'static [ReplyCode])>;
/// Recognized kinds of SMTP reply codes /// Recognized kinds of SMTP reply codes
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ReplyCode { pub enum ReplyCode {
/// System status, or system help reply /// System status, or system help reply
_211, _211,
@ -1006,7 +1006,7 @@ impl TryFrom<&'_ str> for ReplyCode {
} }
/// A single line or multi-line server reply, along with its reply code /// A single line or multi-line server reply, along with its reply code
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct Reply<'s> { pub struct Reply<'s> {
pub code: ReplyCode, pub code: ReplyCode,
pub lines: SmallVec<[&'s str; 16]>, pub lines: SmallVec<[&'s str; 16]>,
@ -1123,7 +1123,7 @@ mod test {
use super::*; use super::*;
const ADDRESS: &str = "localhost:8825"; const ADDRESS: &str = "localhost:8825";
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
enum Message { enum Message {
Helo, Helo,
Mail { Mail {
@ -1147,7 +1147,7 @@ mod test {
type QueuedMail = ((IpAddr, String), Message); type QueuedMail = ((IpAddr, String), Message);
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
struct MyHandler { struct MyHandler {
mails: Arc<Mutex<Vec<QueuedMail>>>, mails: Arc<Mutex<Vec<QueuedMail>>>,
stored: Arc<Mutex<Vec<(String, crate::Envelope)>>>, stored: Arc<Mutex<Vec<(String, crate::Envelope)>>>,

@ -31,7 +31,7 @@ use super::{
types::{LineBreakClass, Reflow}, types::{LineBreakClass, Reflow},
}; };
#[derive(Default, Debug, Eq, PartialEq, Copy, Clone)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum LineBreakCandidate { pub enum LineBreakCandidate {
MandatoryBreak, MandatoryBreak,
BreakAllowed, BreakAllowed,
@ -1205,7 +1205,7 @@ mod segment_tree {
use smallvec::SmallVec; use smallvec::SmallVec;
#[derive(Default, Debug, Clone)] #[derive(Clone, Debug, Default)]
pub(super) struct SegmentTree { pub(super) struct SegmentTree {
array: SmallVec<[usize; 1024]>, array: SmallVec<[usize; 1024]>,
tree: SmallVec<[usize; 1024]>, tree: SmallVec<[usize; 1024]>,
@ -1282,7 +1282,7 @@ mod segment_tree {
/// A lazy stateful iterator for line breaking text. Useful for very long text /// A lazy stateful iterator for line breaking text. Useful for very long text
/// where you don't want to linebreak it completely before user requests /// where you don't want to linebreak it completely before user requests
/// specific lines. /// specific lines.
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
pub struct LineBreakText { pub struct LineBreakText {
text: String, text: String,
reflow: Reflow, reflow: Reflow,
@ -1292,7 +1292,7 @@ pub struct LineBreakText {
state: ReflowState, state: ReflowState,
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
enum ReflowState { enum ReflowState {
No { No {
cur_index: usize, cur_index: usize,
@ -1323,7 +1323,7 @@ impl ReflowState {
} }
} }
#[derive(Debug, Clone)] #[derive(Clone, Debug)]
enum LineBreakTextState { enum LineBreakTextState {
AtLine { AtLine {
cur_index: usize, cur_index: usize,

@ -20,7 +20,7 @@
*/ */
#[allow(clippy::upper_case_acronyms)] #[allow(clippy::upper_case_acronyms)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum LineBreakClass { pub enum LineBreakClass {
BK, BK,
CM, CM,
@ -123,7 +123,7 @@ impl From<&str> for LineBreakClass {
} }
} }
#[derive(PartialEq, Eq, Debug, Copy, Clone, Default)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum Reflow { pub enum Reflow {
No, No,
All, All,

@ -465,7 +465,7 @@ impl SubjectPrefix for &str {
} }
} }
#[derive(Default, Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Thread { pub struct Thread {
pub root: ThreadNodeHash, pub root: ThreadNodeHash,
pub date: UnixTimestamp, pub date: UnixTimestamp,

@ -92,7 +92,7 @@ extern "C" {
#[cfg(not(target_os = "openbsd"))] #[cfg(not(target_os = "openbsd"))]
#[repr(i32)] #[repr(i32)]
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
#[allow(dead_code)] #[allow(dead_code)]
enum LocaleCategoryMask { enum LocaleCategoryMask {
Time = libc::LC_TIME_MASK, Time = libc::LC_TIME_MASK,
@ -104,7 +104,7 @@ const _LC_LAST: c_int = 7;
#[cfg(target_os = "openbsd")] #[cfg(target_os = "openbsd")]
#[repr(i32)] #[repr(i32)]
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
#[allow(dead_code)] #[allow(dead_code)]
enum LocaleCategoryMask { enum LocaleCategoryMask {
Time = 1 << libc::LC_TIME, Time = 1 << libc::LC_TIME,
@ -112,7 +112,7 @@ enum LocaleCategoryMask {
} }
#[repr(i32)] #[repr(i32)]
#[derive(Copy, Clone)] #[derive(Clone, Copy)]
#[allow(dead_code)] #[allow(dead_code)]
enum LocaleCategory { enum LocaleCategory {
Time = libc::LC_TIME, Time = libc::LC_TIME,

@ -31,7 +31,7 @@ use std::{
use log::{Level, LevelFilter, Log, Metadata, Record}; use log::{Level, LevelFilter, Log, Metadata, Record};
#[derive(Copy, Clone, Default, Eq, PartialEq, PartialOrd, Hash, Debug, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, PartialOrd, Serialize)]
#[repr(u8)] #[repr(u8)]
pub enum LogLevel { pub enum LogLevel {
OFF = 0, OFF = 0,
@ -125,7 +125,7 @@ impl std::fmt::Display for LogLevel {
use LogLevel::*; use LogLevel::*;
#[derive(Copy, Clone, Default, Eq, PartialEq, PartialOrd, Hash, Debug, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, Hash, PartialEq, PartialOrd, Serialize)]
pub enum Destination { pub enum Destination {
File, File,
#[default] #[default]

@ -48,7 +48,7 @@ pub mod html_escape {
/// ``` /// ```
/// ///
/// Source: <https://www.w3.org/MarkUp/html-spec/html-spec_9.html#SEC9.7.1> /// Source: <https://www.w3.org/MarkUp/html-spec/html-spec_9.html#SEC9.7.1>
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum HtmlEntity { pub enum HtmlEntity {
/// Less than sign /// Less than sign
Lt, Lt,
@ -161,14 +161,14 @@ macro_rules! declare_u64_hash {
/* Sorting states. */ /* Sorting states. */
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub enum SortOrder { pub enum SortOrder {
Asc, Asc,
#[default] #[default]
Desc, Desc,
} }
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
pub enum SortField { pub enum SortField {
Subject, Subject,
#[default] #[default]

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save