Struct snocat::common::protocol::request_handler::RequestClientHandler [−][src]
pub struct RequestClientHandler { /* fields omitted */ }
Implementations
pub fn new(
tunnel_registry: Arc<dyn TunnelRegistry + Send + Sync + 'static>,
service_registry: Arc<dyn ServiceRegistry + Send + Sync + 'static>,
router: Arc<dyn Router + Send + Sync + 'static>
) -> Self
pub fn handle<TProtocolClient: Client + Send + Sync + 'static>(
self: Arc<Self>,
address: RouteAddress,
client: TProtocolClient
) -> BoxFuture<'static, Result<TProtocolClient::Response, RequestHandlingError>>
pub fn handle<TProtocolClient: Client + Send + Sync + 'static>(
self: Arc<Self>,
address: RouteAddress,
client: TProtocolClient
) -> BoxFuture<'static, Result<TProtocolClient::Response, RequestHandlingError>>
Routes a request and returns its ProtocolClient::Response-typed response.
pub fn handle_direct<TProtocolClient: Client + Send + Sync + 'static>(
self: Arc<Self>,
direct_address: RouteAddress,
client: TProtocolClient,
link: Box<dyn TunnelStream + Send + 'static>
) -> BoxFuture<'static, Result<TProtocolClient::Response, RequestHandlingError>>
pub fn handle_direct<TProtocolClient: Client + Send + Sync + 'static>(
self: Arc<Self>,
direct_address: RouteAddress,
client: TProtocolClient,
link: Box<dyn TunnelStream + Send + 'static>
) -> BoxFuture<'static, Result<TProtocolClient::Response, RequestHandlingError>>
Handles making a request through a provided link, skipping the routing phase
pub fn handle_dynamic_direct(
self: Arc<Self>,
request: Request,
direct_address: RouteAddress,
link: Box<dyn TunnelStream + Send + 'static>
) -> BoxFuture<'static, Result<Response, RequestHandlingError>>
pub fn handle_dynamic_direct(
self: Arc<Self>,
request: Request,
direct_address: RouteAddress,
link: Box<dyn TunnelStream + Send + 'static>
) -> BoxFuture<'static, Result<Response, RequestHandlingError>>
Handles making a request through a provided link, skipping the routing phase, but with the possibility of returning a type that may not match the one expected.
pub fn handle_dynamic(
self: Arc<Self>,
request: Request
) -> BoxFuture<'static, Result<Response, RequestHandlingError>>
pub fn handle_dynamic(
self: Arc<Self>,
request: Request
) -> BoxFuture<'static, Result<Response, RequestHandlingError>>
Routes a request and returns its response with dynamic/“Any” typing.
pub fn negotiate_link(
self: Arc<Self>,
addr: &RouteAddress,
link: Box<dyn TunnelStream + Send + 'static>
) -> BoxFuture<'static, Result<Box<dyn TunnelStream + Send + 'static>, NegotiationError>>
Auto Trait Implementations
impl !RefUnwindSafe for RequestClientHandler
impl Send for RequestClientHandler
impl Sync for RequestClientHandler
impl Unpin for RequestClientHandler
impl !UnwindSafe for RequestClientHandler
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