pub struct ChannelHandle { /* private fields */ }Expand description
Exclusive handle to a channel.
Implementations§
Source§impl ChannelHandle
impl ChannelHandle
pub fn chan_id(&self) -> u32
pub fn peer_data(&self) -> &PeerData
pub fn protocol(&self) -> Topic
pub fn topic(&self) -> Topic
Sourcepub async fn send_payload(
&mut self,
payload: Vec<u8>,
flags: MsgFlags,
) -> Result<(), Error>
pub async fn send_payload( &mut self, payload: Vec<u8>, flags: MsgFlags, ) -> Result<(), Error>
Sends an exact payload and optionally closes the channel.
Sourcepub async fn send_and_close(&mut self, payload: Vec<u8>) -> Result<(), Error>
pub async fn send_and_close(&mut self, payload: Vec<u8>) -> Result<(), Error>
Sends a message and closes the local side of the channel. New messages may still be received until the remote side closes their side too.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChannelHandle
impl RefUnwindSafe for ChannelHandle
impl Send for ChannelHandle
impl Sync for ChannelHandle
impl Unpin for ChannelHandle
impl UnwindSafe for ChannelHandle
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