Struct litep2p::protocol::notification::NotificationSink
source · pub struct NotificationSink { /* private fields */ }
Expand description
Notification sink.
Allows the user to send notifications both synchronously and asynchronously.
Implementations§
source§impl NotificationSink
impl NotificationSink
sourcepub fn send_sync_notification(
&self,
notification: Vec<u8>,
) -> Result<(), NotificationError>
pub fn send_sync_notification( &self, notification: Vec<u8>, ) -> Result<(), NotificationError>
Send notification to peer
synchronously.
If the channel is clogged, NotificationError::ChannelClogged
is returned.
sourcepub async fn send_async_notification(&self, notification: Vec<u8>) -> Result<()>
pub async fn send_async_notification(&self, notification: Vec<u8>) -> Result<()>
Send notification to peer
asynchronously, waiting for the channel to have capacity
if it’s clogged.
Returns Error::PeerDoesntExist(PeerId)
if the connection has been closed.
Trait Implementations§
source§impl Clone for NotificationSink
impl Clone for NotificationSink
source§fn clone(&self) -> NotificationSink
fn clone(&self) -> NotificationSink
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for NotificationSink
impl RefUnwindSafe for NotificationSink
impl Send for NotificationSink
impl Sync for NotificationSink
impl Unpin for NotificationSink
impl UnwindSafe for NotificationSink
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)