make Backend::get_mboxes return struct instead of trait (#340)

This step was necessary to move logic from CLI to lib. Indeed, the
trait returned by get_mboxes needed to implement Table, which is
related to the CLI module only.
This commit is contained in:
Clément DOUIN
2022-05-29 12:36:10 +02:00
parent a0461d84ba
commit 7c01f88006
20 changed files with 193 additions and 575 deletions
+3 -5
View File
@@ -4,11 +4,9 @@
//! custom backend implementations.
use anyhow::Result;
use himalaya_lib::mbox::Mboxes;
use crate::{
mbox::Mboxes,
msg::{Envelopes, Msg},
};
use crate::msg::{Envelopes, Msg};
pub trait Backend<'a> {
fn connect(&mut self) -> Result<()> {
@@ -16,7 +14,7 @@ pub trait Backend<'a> {
}
fn add_mbox(&mut self, mbox: &str) -> Result<()>;
fn get_mboxes(&mut self) -> Result<Box<dyn Mboxes>>;
fn get_mboxes(&mut self) -> Result<Mboxes>;
fn del_mbox(&mut self, mbox: &str) -> Result<()>;
fn get_envelopes(
&mut self,