Struct snocat::server::modular::ModularDaemon [−][src]
pub struct ModularDaemon<TTunnel> { pub tunnel_connected: Broadcaster<(TunnelId, Arc<TTunnel>)>, pub tunnel_authenticated: Broadcaster<(TunnelId, TunnelName, Arc<TTunnel>)>, pub tunnel_disconnected: Broadcaster<(TunnelId, Option<TunnelName>)>, // some fields omitted }
Fields
tunnel_connected: Broadcaster<(TunnelId, Arc<TTunnel>)>
tunnel_authenticated: Broadcaster<(TunnelId, TunnelName, Arc<TTunnel>)>
tunnel_disconnected: Broadcaster<(TunnelId, Option<TunnelName>)>
Implementations
pub fn new(
service_registry: Arc<dyn ServiceRegistry + Send + Sync + 'static>,
tunnel_registry: Arc<dyn TunnelRegistry + Send + Sync + 'static>,
router: Arc<dyn Router + Send + Sync + 'static>,
authentication_handler: Arc<dyn AuthenticationHandler + Send + Sync + 'static>,
tunnel_id_generator: Arc<dyn TunnelIDGenerator + Send + Sync + 'static>
) -> Self
pub fn run<TunnelSource, TIntoTunnel>(
self: Arc<Self>,
tunnel_source: TunnelSource,
shutdown_request_listener: CancellationToken
) -> JoinHandle<()> where
TunnelSource: Stream<Item = TIntoTunnel> + Send + 'static,
TIntoTunnel: Into<TTunnel>,
TTunnel: Tunnel + 'static,
pub fn run<TunnelSource, TIntoTunnel>(
self: Arc<Self>,
tunnel_source: TunnelSource,
shutdown_request_listener: CancellationToken
) -> JoinHandle<()> where
TunnelSource: Stream<Item = TIntoTunnel> + Send + 'static,
TIntoTunnel: Into<TTunnel>,
TTunnel: Tunnel + 'static,
Run the server against a tunnel_source.
This can be performed concurrently against multiple sources, with a shared server instance. The implementation assumes that shutdown_request_listener will also halt the tunnel_source.
Auto Trait Implementations
impl<TTunnel> !RefUnwindSafe for ModularDaemon<TTunnel>
impl<TTunnel> Send for ModularDaemon<TTunnel> where
TTunnel: Send + Sync,
impl<TTunnel> Sync for ModularDaemon<TTunnel> where
TTunnel: Send + Sync,
impl<TTunnel> Unpin for ModularDaemon<TTunnel>
impl<TTunnel> !UnwindSafe for ModularDaemon<TTunnel>
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more