pub struct MethodRouter { /* private fields */ }Implementations§
Source§impl MethodRouter
impl MethodRouter
pub fn new() -> Self
pub fn unary<Req, Res, F, Fut>(&self, method: impl Into<String>, f: F) -> &Self
Sourcepub fn unary_with_request<Req, Res, F, Fut>(
&self,
method: impl Into<String>,
f: F,
) -> &Self
pub fn unary_with_request<Req, Res, F, Fut>( &self, method: impl Into<String>, f: F, ) -> &Self
Unary handler with access to the incoming HTTP Request (auth, state, headers).
pub async fn invoke_raw( &self, method: &str, body: Bytes, ) -> Result<Bytes, GrpcError>
pub async fn invoke_with_request( &self, method: &str, http_req: Request, body: Bytes, ) -> Result<Bytes, GrpcError>
pub async fn invoke<Req, Res>(
&self,
method: &str,
req: &Req,
) -> Result<Res, GrpcError>where
Req: Serialize,
Res: DeserializeOwned,
pub fn methods(&self) -> Vec<String>
Trait Implementations§
Source§impl Clone for MethodRouter
impl Clone for MethodRouter
Source§fn clone(&self) -> MethodRouter
fn clone(&self) -> MethodRouter
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 MethodRouter
impl Default for MethodRouter
Source§fn default() -> MethodRouter
fn default() -> MethodRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MethodRouter
impl RefUnwindSafe for MethodRouter
impl Send for MethodRouter
impl Sync for MethodRouter
impl Unpin for MethodRouter
impl UnsafeUnpin for MethodRouter
impl UnwindSafe for MethodRouter
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