pub struct DynamicRoute { /* private fields */ }Expand description
A set of dynamic API routes.
Dynamic routes allow for processes to dynamically register/unregister themselves from running API endpoints, adapting to changes in the process state and without requiring all routes to be known and declared upfront.
Implementations§
Source§impl DynamicRoute
impl DynamicRoute
Sourcepub fn http<T: APIHandler>(endpoint_type: EndpointType, handler: T) -> Self
pub fn http<T: APIHandler>(endpoint_type: EndpointType, handler: T) -> Self
Creates a dynamic HTTP route from the given API handler.
Sourcepub fn grpc(endpoint_type: EndpointType, routes: Routes) -> Self
pub fn grpc(endpoint_type: EndpointType, routes: Routes) -> Self
Creates a dynamic gRPC route from the given Tonic routes.
Sourcepub fn endpoint_type(&self) -> EndpointType
pub fn endpoint_type(&self) -> EndpointType
Returns the type of endpoint these routes target.
Sourcepub fn endpoint_protocol(&self) -> EndpointProtocol
pub fn endpoint_protocol(&self) -> EndpointProtocol
Returns the protocol of endpoint these routes target.
Sourcepub fn into_router(self) -> Router<()>
pub fn into_router(self) -> Router<()>
Consumes this route and returns the underlying router.
Trait Implementations§
Source§impl Clone for DynamicRoute
impl Clone for DynamicRoute
Source§fn clone(&self) -> DynamicRoute
fn clone(&self) -> DynamicRoute
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicRoute
impl !RefUnwindSafe for DynamicRoute
impl Send for DynamicRoute
impl Sync for DynamicRoute
impl Unpin for DynamicRoute
impl UnsafeUnpin for DynamicRoute
impl !UnwindSafe for DynamicRoute
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request