pub struct RpcSession<C, T, S>where
C: Codec,
T: Transport,
S: SessionState,{ /* private fields */ }Implementations§
Source§impl<C, T, S> RpcSession<C, T, S>where
T: Transport,
C: Codec,
S: SessionState,
impl<C, T, S> RpcSession<C, T, S>where
T: Transport,
C: Codec,
S: SessionState,
pub fn create( transport: T, codec: C, handler: Arc<dyn RpcSessionHandler<State = S>>, state: S, ) -> Arc<Self>
pub async fn start(self: Arc<Self>)
pub async fn notify(&self, event: &Event) -> Result<()>
pub async fn send_binary(&self, data: Vec<u8>) -> Result<()>
pub async fn request( &self, request: &Request, timeout: Option<Duration>, ) -> Result<RequestResult, RpcSessionError>
Trait Implementations§
Source§impl<C, T, S> SessionContext for RpcSession<C, T, S>where
C: Codec,
T: Transport,
S: SessionState,
impl<C, T, S> SessionContext for RpcSession<C, T, S>where
C: Codec,
T: Transport,
S: SessionState,
type State = S
fn state(&self) -> &Self::State
fn send_binary<'life0, 'async_trait>(
&'life0 self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 Event,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 Request,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<RequestResult, RpcSessionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<C, T, S> Freeze for RpcSession<C, T, S>where
C: Freeze,
impl<C, T, S> !RefUnwindSafe for RpcSession<C, T, S>
impl<C, T, S> Send for RpcSession<C, T, S>
impl<C, T, S> Sync for RpcSession<C, T, S>
impl<C, T, S> Unpin for RpcSession<C, T, S>
impl<C, T, S> UnsafeUnpin for RpcSession<C, T, S>where
C: UnsafeUnpin,
impl<C, T, S> !UnwindSafe for RpcSession<C, T, S>
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