From a04855a252f57086314a294efa4192a54798c1e6 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 30 May 2024 23:46:01 +0200 Subject: [PATCH] Redifine origin::mux to be actually usable --- src/origin/mux.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/origin/mux.rs b/src/origin/mux.rs index ff55a9a..611dd0e 100644 --- a/src/origin/mux.rs +++ b/src/origin/mux.rs @@ -1,27 +1,24 @@ use crate::error::unexpected::Mappable; use crate::{origin, util}; +use std::sync::Arc; -pub struct Store +pub struct Store where - F: Fn(&origin::Descr) -> Option + Sync + Send, + F: Fn(&origin::Descr) -> Option> + Sync + Send, { mapping_fn: F, } -impl Store +pub fn new(mapping_fn: F) -> Store where - S: origin::Store + Sync + Send + 'static, - F: Fn(&origin::Descr) -> Option + Sync + Send, + F: Fn(&origin::Descr) -> Option> + Sync + Send, { - pub fn new(mapping_fn: F) -> Store { - Store { mapping_fn } - } + Store { mapping_fn } } -impl origin::Store for Store +impl origin::Store for Store where - S: origin::Store + Sync + Send + 'static, - F: Fn(&origin::Descr) -> Option + Sync + Send, + F: Fn(&origin::Descr) -> Option> + Sync + Send, { fn sync(&self, descr: &origin::Descr) -> util::BoxFuture<'_, Result<(), origin::SyncError>> { let descr = descr.clone();