Skip to main content

Transport

Struct Transport 

Source
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: TransportConfig

Implementations§

Source§

impl<I: InternalTransport, Name: RpcName> Transport<I, Name>

Source

pub fn new(internal_transport: I, transport_config: TransportConfig) -> Self

Source

pub async fn send_query( &mut self, query_bytes: Bytes<'_>, rpc_name: &Name, ) -> RpcResult<OwnedBytes>

Source

pub async fn receive_query(&mut self) -> RpcResult<ReceivedQuery<Name>>

Source

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>
where I: Send, Name: Send,

§

impl<I, Name> Sync for Transport<I, Name>
where I: Sync, Name: Sync,

§

impl<I, Name> Unpin for Transport<I, Name>
where I: Unpin, Name: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.