pub struct Transport<I, Name> {
pub config: TransportConfig,
/* private fields */
}Expand description
Transport for data betweeen client and server, generic over the rpc names and internal transport The majority of the heavy lifting is done by the [internal_transport], see the definition of the InternalTransport trait for more information
Fields§
§config: TransportConfigImplementations§
Source§impl<I: InternalTransport, Name: RpcName> Transport<I, Name>
impl<I: InternalTransport, Name: RpcName> Transport<I, Name>
pub fn new(internal_transport: I, transport_config: TransportConfig) -> Self
pub async fn send_query( &mut self, query_bytes: Bytes<'_>, rpc_name: &Name, ) -> RpcResult<OwnedBytes>
pub async fn receive_query(&mut self) -> RpcResult<ReceivedQuery<Name>>
pub async fn respond(&mut self, bytes: Bytes<'_>) -> RpcResult<()>
Auto Trait Implementations§
impl<I, Name> Freeze for Transport<I, Name>where
I: Freeze,
impl<I, Name> RefUnwindSafe for Transport<I, Name>where
I: RefUnwindSafe,
Name: RefUnwindSafe,
impl<I, Name> Send for Transport<I, Name>
impl<I, Name> Sync for Transport<I, Name>
impl<I, Name> Unpin for Transport<I, Name>
impl<I, Name> UnsafeUnpin for Transport<I, Name>where
I: UnsafeUnpin,
impl<I, Name> UnwindSafe for Transport<I, Name>where
I: UnwindSafe,
Name: UnwindSafe,
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