[−][src]Trait rsocket_rust::prelude::RSocket
A contract providing different interaction models for RSocket protocol.
RSocket trait is based on async_trait
crate.
Example
use rsocket_rust::prelude::*; use rsocket_rust::{async_trait, stream, Result}; struct ExampleRSocket; #[async_trait] impl RSocket for ExampleRSocket { async fn metadata_push(&self, req: Payload) -> Result<()> { Ok(()) } async fn fire_and_forget(&self, req: Payload) -> Result<()> { Ok(()) } async fn request_response(&self, req: Payload) -> Result<Option<Payload>> { Ok(Some(Payload::builder().set_data_utf8("bingo").build())) } fn request_stream(&self, req: Payload) -> Flux<Result<Payload>> { Box::pin(stream! { for _ in 0..3 { yield Ok(Payload::builder().set_data_utf8("next payload").build()); } }) } fn request_channel(&self, reqs: Flux<Result<Payload>>) -> Flux<Result<Payload>> { reqs } }
Required methods
#[must_use]pub fn metadata_push<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Metadata-Push interaction model of RSocket.
#[must_use]pub fn fire_and_forget<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Fire and Forget interaction model of RSocket.
#[must_use]pub fn request_response<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Request-Response interaction model of RSocket.
pub fn request_stream(&self, req: Payload) -> Flux<Result<Payload>>
[src]
Request-Stream interaction model of RSocket.
pub fn request_channel(
&self,
reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>
[src]
&self,
reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>
Request-Channel interaction model of RSocket.
Implementors
impl RSocket for Client
[src]
pub fn metadata_push<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn fire_and_forget<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn request_response<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn request_stream(&self, req: Payload) -> Flux<Result<Payload>>
[src]
pub fn request_channel(
&self,
reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>
[src]
&self,
reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>
impl RSocket for EchoRSocket
[src]
pub fn metadata_push<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn fire_and_forget<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn request_response<'life0, 'async_trait>(
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
req: Payload
) -> Pin<Box<dyn Future<Output = Result<Option<Payload>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
pub fn request_stream(&self, req: Payload) -> Flux<Result<Payload>>
[src]
pub fn request_channel(
&self,
mut reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>
[src]
&self,
mut reqs: Flux<Result<Payload>>
) -> Flux<Result<Payload>>