pub struct GrpcServer { /* private fields */ }Expand description
gRPC-Server-Skeleton.
Implementations§
Source§impl GrpcServer
impl GrpcServer
Sourcepub fn process_frame(
&mut self,
input: &[u8],
) -> Result<(Option<GrpcRequest>, usize), &'static str>
pub fn process_frame( &mut self, input: &[u8], ) -> Result<(Option<GrpcRequest>, usize), &'static str>
Verarbeitet ein eingehendes HTTP/2-Frame-Bytestrom-Slice.
Liefert eine optional dekodierte gRPC-Request, wenn der Stream
vollstaendig ist (END_STREAM empfangen).
§Errors
Static-String bei Protokoll-Verletzung.
Sourcepub fn encode_response(
&mut self,
resp: &GrpcResponse,
) -> Result<Vec<u8>, &'static str>
pub fn encode_response( &mut self, resp: &GrpcResponse, ) -> Result<Vec<u8>, &'static str>
Encodiert eine GrpcResponse zu einem HTTP/2-Bytestrom
(HEADERS + DATA + Trailer-HEADERS).
§Errors
Static-String bei Encode-Fehlern.
Sourcepub fn decode_request_body(
&self,
req: &GrpcRequest,
) -> Result<Vec<u8>, &'static str>
pub fn decode_request_body( &self, req: &GrpcRequest, ) -> Result<Vec<u8>, &'static str>
Versucht, einen Request-Body als LPM-Frame zu dekodieren. Convenience fuer Caller.
§Errors
Static-String wenn die Length-Prefixed-Message korrupt ist.
Trait Implementations§
Source§impl Clone for GrpcServer
impl Clone for GrpcServer
Source§fn clone(&self) -> GrpcServer
fn clone(&self) -> GrpcServer
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 Debug for GrpcServer
impl Debug for GrpcServer
Source§impl Default for GrpcServer
impl Default for GrpcServer
Source§fn default() -> GrpcServer
fn default() -> GrpcServer
Returns the “default value” for a type. Read more
Source§impl PartialEq for GrpcServer
impl PartialEq for GrpcServer
Source§fn eq(&self, other: &GrpcServer) -> bool
fn eq(&self, other: &GrpcServer) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for GrpcServer
impl StructuralPartialEq for GrpcServer
Auto Trait Implementations§
impl Freeze for GrpcServer
impl RefUnwindSafe for GrpcServer
impl Send for GrpcServer
impl Sync for GrpcServer
impl Unpin for GrpcServer
impl UnsafeUnpin for GrpcServer
impl UnwindSafe for GrpcServer
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