pub struct HttpRouter { /* private fields */ }Expand description
A table of HTTP bindings compiled from a descriptor pool.
Implementations§
Source§impl HttpRouter
impl HttpRouter
Sourcepub fn from_pool(pool: &DescriptorPool) -> Self
pub fn from_pool(pool: &DescriptorPool) -> Self
Compile all google.api.http bindings in the pool. Empty if the pool has
no annotations (or the extension isn’t present).
pub fn is_empty(&self) -> bool
Sourcepub fn match_ws(&self, path: &str, query: Option<&str>) -> Option<WsBinding>
pub fn match_ws(&self, path: &str, query: Option<&str>) -> Option<WsBinding>
Match a WebSocket upgrade path against the annotation bindings. A WS upgrade is always an HTTP GET, so this matches on the path only (verb-agnostic).
Sourcepub fn is_annotated(&self, grpc_method: &str) -> bool
pub fn is_annotated(&self, grpc_method: &str) -> bool
Whether a gRPC method (/pkg.Service/Method) has any HTTP annotation.
Trait Implementations§
Source§impl Clone for HttpRouter
impl Clone for HttpRouter
Source§fn clone(&self) -> HttpRouter
fn clone(&self) -> HttpRouter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for HttpRouter
impl Default for HttpRouter
Source§fn default() -> HttpRouter
fn default() -> HttpRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HttpRouter
impl RefUnwindSafe for HttpRouter
impl Send for HttpRouter
impl Sync for HttpRouter
impl Unpin for HttpRouter
impl UnsafeUnpin for HttpRouter
impl UnwindSafe for HttpRouter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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