mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-17 21:37:55 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user