pub struct UnicastTextChatWrapper<T: Transport + Clone> { /* private fields */ }Expand description
Thin convenience wrapper for plain unicast text chat over a peer connection.
Implementations§
Source§impl<T: Transport + Clone> UnicastTextChatWrapper<T>
impl<T: Transport + Clone> UnicastTextChatWrapper<T>
pub fn new(peer: PeerConnection<T>) -> Self
pub fn from_peer(peer: &PeerConnection<T>) -> Self
pub fn peer_connection(&self) -> &PeerConnection<T>
pub fn peer(&self) -> &PublicKey
pub async fn send_message( &self, message: &TextMessage<'_>, options: &SendOptions, ) -> Result<SendProgressTicket, TextSendError<T::Error>>
pub async fn send_owned_message( &self, message: &OwnedTextMessage, options: &SendOptions, ) -> Result<SendProgressTicket, TextSendError<T::Error>>
pub async fn send_text( &self, body: &str, options: &SendOptions, ) -> Result<SendProgressTicket, TextSendError<T::Error>>
Source§impl<M: MacBackend> UnicastTextChatWrapper<LocalNode<M>>
impl<M: MacBackend> UnicastTextChatWrapper<LocalNode<M>>
pub fn on_text<F>(&self, handler: F) -> Subscription
pub fn on_text_with_diagnostics<F, D>(
&self,
handler: F,
diagnostics: D,
) -> Subscriptionwhere
F: FnMut(&ReceivedPacketRef<'_>, TextMessage<'_>) + 'static,
D: FnMut(&ReceivedPacketRef<'_>, TextReceiveIssue) + 'static,
Trait Implementations§
Source§impl<T: Clone + Transport + Clone> Clone for UnicastTextChatWrapper<T>
impl<T: Clone + Transport + Clone> Clone for UnicastTextChatWrapper<T>
Source§fn clone(&self) -> UnicastTextChatWrapper<T>
fn clone(&self) -> UnicastTextChatWrapper<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for UnicastTextChatWrapper<T>where
T: Freeze,
impl<T> RefUnwindSafe for UnicastTextChatWrapper<T>where
T: RefUnwindSafe,
impl<T> Send for UnicastTextChatWrapper<T>where
T: Send,
impl<T> Sync for UnicastTextChatWrapper<T>where
T: Sync,
impl<T> Unpin for UnicastTextChatWrapper<T>where
T: Unpin,
impl<T> UnwindSafe for UnicastTextChatWrapper<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)