melib/backends: move IsSubscribedFn to backends mod
parent
7e977fe627
commit
fee8f5b575
|
@ -690,3 +690,18 @@ fn test_lazy_count_set() {
|
||||||
assert!(!new.insert_existing(10));
|
assert!(!new.insert_existing(10));
|
||||||
assert_eq!(new.len(), 10);
|
assert_eq!(new.len(), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct IsSubscribedFn(Box<dyn Fn(&str) -> bool + Send + Sync>);
|
||||||
|
|
||||||
|
impl std::fmt::Debug for IsSubscribedFn {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
|
write!(f, "IsSubscribedFn Box")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl std::ops::Deref for IsSubscribedFn {
|
||||||
|
type Target = Box<dyn Fn(&str) -> bool + Send + Sync>;
|
||||||
|
fn deref(&self) -> &Box<dyn Fn(&str) -> bool + Send + Sync> {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -100,20 +100,6 @@ pub struct ImapServerConf {
|
||||||
pub timeout: Option<Duration>,
|
pub timeout: Option<Duration>,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct IsSubscribedFn(Box<dyn Fn(&str) -> bool + Send + Sync>);
|
|
||||||
|
|
||||||
impl std::fmt::Debug for IsSubscribedFn {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
|
||||||
write!(f, "IsSubscribedFn Box")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::ops::Deref for IsSubscribedFn {
|
|
||||||
type Target = Box<dyn Fn(&str) -> bool + Send + Sync>;
|
|
||||||
fn deref(&self) -> &Box<dyn Fn(&str) -> bool + Send + Sync> {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type Capabilities = HashSet<Vec<u8>>;
|
type Capabilities = HashSet<Vec<u8>>;
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
|
@ -146,20 +146,6 @@ impl JmapServerConf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct IsSubscribedFn(Box<dyn Fn(&str) -> bool + Send + Sync>);
|
|
||||||
|
|
||||||
impl std::fmt::Debug for IsSubscribedFn {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
|
||||||
write!(f, "IsSubscribedFn Box")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::ops::Deref for IsSubscribedFn {
|
|
||||||
type Target = Box<dyn Fn(&str) -> bool + Send + Sync>;
|
|
||||||
fn deref(&self) -> &Box<dyn Fn(&str) -> bool + Send + Sync> {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
macro_rules! get_conf_val {
|
macro_rules! get_conf_val {
|
||||||
($s:ident[$var:literal]) => {
|
($s:ident[$var:literal]) => {
|
||||||
$s.extra.get($var).ok_or_else(|| {
|
$s.extra.get($var).ok_or_else(|| {
|
||||||
|
|
|
@ -66,20 +66,6 @@ pub struct NntpServerConf {
|
||||||
pub extension_use: NntpExtensionUse,
|
pub extension_use: NntpExtensionUse,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct IsSubscribedFn(Box<dyn Fn(&str) -> bool + Send + Sync>);
|
|
||||||
|
|
||||||
impl std::fmt::Debug for IsSubscribedFn {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
|
||||||
write!(f, "IsSubscribedFn Box")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::ops::Deref for IsSubscribedFn {
|
|
||||||
type Target = Box<dyn Fn(&str) -> bool + Send + Sync>;
|
|
||||||
fn deref(&self) -> &Box<dyn Fn(&str) -> bool + Send + Sync> {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type Capabilities = HashSet<String>;
|
type Capabilities = HashSet<String>;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Reference in New Issue