pub fn send(self, notification: impl Into<Vec<u8>>) -> Result<(), NotificationSenderError> {
		let notification = notification.into();

		if let Some(notification_size_metric) = &self.notification_size_metric {
			notification_size_metric.observe(notification.len() as f64);
		}

		trace!(
			target: "sub-libp2p",
			"External API => Notification({:?}, {:?}, {} bytes)",
			self.peer_id,
			self.ready.protocol_name(),
			notification.len()
		);
		trace!(target: "sub-libp2p", "Handler({:?}) <= Async notification", self.peer_id);

		self.ready
			.send(notification)
			.map_err(|()| NotificationSenderError::Closed)
	}
/// Consumes this slots reservation and actually queues the notification.
Consumes this slots reservation and actually queues the notification.
Consumes this slots reservation and actually queues the notification .
pub fn send(self, notification: impl Into<Vec<u8>>) -> Result<(), NotificationSenderError> {
		let notification = notification.into();
		if let Some(notification_size_metric) = &self.notification_size_metric {
			notification_size_metric.observe(notification.len() as f64);
		}
		trace!(
			target: "sub-libp2p",
			"External API => Notification({:?}, {:?}, {} bytes)",
			self.peer_id,
			self.ready.protocol_name(),
			notification.len()
		);
		trace!(target: "sub-libp2p", "Handler({:?}) <= Async notification", self.peer_id);
		self.ready
			.send(notification)
			.map_err(|()| NotificationSenderError::Closed)
	}
pub fn send ( self , notification : impl Into < Vec < u8 > > ) -> Result < ( ) , NotificationSenderError > { let notification = notification . into ( ) ; if let Some ( notification_size_metric ) = & self . notification_size_metric { notification_size_metric . observe ( notification . len ( ) as f64 ) ; } trace ! ( target " " " " self peer_id self ready protocol_name ( ) notification len ( ) ) ; trace ! ( target " " " " self peer_id ) ; self . ready . send ( notification ) . map_err ( | ( ) | NotificationSenderError :: Closed ) }
Consumes this slots reservation and actually queues the notification.
Consumes this slots reservation and actually queues the notification .
self
notification
impl Into<Vec<u8>>
self
notification
impl Into<Vec<u8>>