pub struct DrainSession { /* private fields */ }Implementations§
Source§impl DrainSession
impl DrainSession
pub async fn open( &mut self, node_id: &str, channel_id: u32, kind: ChannelKind, ) -> Result<(), DrainError>
pub async fn resume(&mut self, after: u64) -> Result<(), DrainError>
pub async fn ack(&mut self, seq: u64) -> Result<(), DrainError>
Sourcepub async fn send_data(
&mut self,
channel_id: u32,
payload: Vec<u8>,
) -> Result<(), DrainError>
pub async fn send_data( &mut self, channel_id: u32, payload: Vec<u8>, ) -> Result<(), DrainError>
Downlink: send opaque bytes to the node selected by open (C2 relays as-is).
Sourcepub async fn recv_envelope(
&mut self,
deadline: Duration,
) -> Result<Option<DrainEnvelope>, DrainError>
pub async fn recv_envelope( &mut self, deadline: Duration, ) -> Result<Option<DrainEnvelope>, DrainError>
Next drained envelope, or None on timeout. EOF is Err(Closed). Non-DATA
control frames from C2 (e.g. PONG) are skipped.
Auto Trait Implementations§
impl !Freeze for DrainSession
impl RefUnwindSafe for DrainSession
impl Send for DrainSession
impl Sync for DrainSession
impl Unpin for DrainSession
impl UnsafeUnpin for DrainSession
impl UnwindSafe for DrainSession
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