pub struct ServerRpc { /* private fields */ }Expand description
Server-side RPC state machine.
Implementations§
Source§impl ServerRpc
impl ServerRpc
Sourcepub fn from_call_start(
ctx: Context,
call_start: CallStart,
writer: Arc<dyn PacketWriter>,
) -> Self
pub fn from_call_start( ctx: Context, call_start: CallStart, writer: Arc<dyn PacketWriter>, ) -> Self
Creates a new ServerRpc from a CallStart packet.
Sourcepub async fn handle_packet(&self, packet: Packet) -> Result<()>
pub async fn handle_packet(&self, packet: Packet) -> Result<()>
Handles an incoming packet.
Sourcepub async fn handle_stream_close(&self, err: Option<String>) -> Result<()>
pub async fn handle_stream_close(&self, err: Option<String>) -> Result<()>
Handles stream close from the transport.
Sourcepub async fn send_error(&self, error: String) -> Result<()>
pub async fn send_error(&self, error: String) -> Result<()>
Sends an error response and closes.
Trait Implementations§
Source§impl Stream for ServerRpc
impl Stream for ServerRpc
Source§fn send_bytes<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_bytes<'life0, 'async_trait>(
&'life0 self,
data: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends raw bytes on the stream. Read more
Source§fn recv_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_bytes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receives raw bytes from the stream. Read more
Auto Trait Implementations§
impl !Freeze for ServerRpc
impl !RefUnwindSafe for ServerRpc
impl !UnwindSafe for ServerRpc
impl Send for ServerRpc
impl Sync for ServerRpc
impl Unpin for ServerRpc
impl UnsafeUnpin for ServerRpc
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