Struct sc_network::NotificationsSink
source · pub struct NotificationsSink { /* private fields */ }
Expand description
Sink connected directly to the node background task. Allows sending notifications to the peer.
Can be cloned in order to obtain multiple references to the substream of the same peer.
Implementations§
source§impl NotificationsSink
impl NotificationsSink
sourcepub fn send_sync_notification(&self, message: impl Into<Vec<u8>>)
pub fn send_sync_notification(&self, message: impl Into<Vec<u8>>)
Sends a notification to the peer.
If too many messages are already buffered, the notification is silently discarded and the connection to the peer will be closed shortly after.
The protocol name is expected to be checked ahead of calling this method. It is a logic error to send a notification using an unknown protocol.
This method will be removed in a future version.
sourcepub async fn reserve_notification(&self) -> Result<Ready<'_>, ()>
pub async fn reserve_notification(&self) -> Result<Ready<'_>, ()>
Wait until the remote is ready to accept a notification.
Returns an error in the case where the connection is closed.
The protocol name is expected to be checked ahead of calling this method. It is a logic error to send a notification using an unknown protocol.
Trait Implementations§
source§impl Clone for NotificationsSink
impl Clone for NotificationsSink
source§fn clone(&self) -> NotificationsSink
fn clone(&self) -> NotificationsSink
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NotificationsSink
impl Send for NotificationsSink
impl Sync for NotificationsSink
impl Unpin for NotificationsSink
impl !UnwindSafe for NotificationsSink
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.