pub struct DtxConnection<S> { /* private fields */ }Expand description
A managed DTX connection with channel multiplexing and method call support.
Implementations§
Source§impl<S: AsyncRead + AsyncWrite + Unpin + Send> DtxConnection<S>
impl<S: AsyncRead + AsyncWrite + Unpin + Send> DtxConnection<S>
pub fn new(stream: S) -> Self
pub async fn send_raw(&mut self, data: &[u8]) -> Result<(), DtxError>
pub async fn send_ack(&mut self, msg: &DtxMessage) -> Result<(), DtxError>
Sourcepub async fn recv(&mut self) -> Result<DtxMessage, DtxError>
pub async fn recv(&mut self) -> Result<DtxMessage, DtxError>
Receive the next fully-assembled DTX message, transparently reassembling fragments.
Sourcepub async fn request_channel(
&mut self,
service_name: &str,
) -> Result<i32, DtxError>
pub async fn request_channel( &mut self, service_name: &str, ) -> Result<i32, DtxError>
Request a DTX channel by service name. Returns the assigned channel code.
Sourcepub async fn method_call(
&mut self,
channel_code: i32,
selector: &str,
args: &[PrimArg],
) -> Result<DtxMessage, DtxError>
pub async fn method_call( &mut self, channel_code: i32, selector: &str, args: &[PrimArg], ) -> Result<DtxMessage, DtxError>
Call a method on a channel and wait for the response.
Auto Trait Implementations§
impl<S> Freeze for DtxConnection<S>where
S: Freeze,
impl<S> RefUnwindSafe for DtxConnection<S>where
S: RefUnwindSafe,
impl<S> Send for DtxConnection<S>where
S: Send,
impl<S> Sync for DtxConnection<S>where
S: Sync,
impl<S> Unpin for DtxConnection<S>where
S: Unpin,
impl<S> UnsafeUnpin for DtxConnection<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for DtxConnection<S>where
S: 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