pub fn new(
		legacy_protocol: RegisteredProtocol,
		list: impl Into<Vec<(Cow<'static, str>, Arc<RwLock<Vec<u8>>>)>>,
	) -> Self {
		let list = list.into();
		assert!(!list.is_empty());

		let out_protocols = list
			.clone()
			.into_iter()
			.collect();

		let in_protocols = list.clone()
			.into_iter()
			.map(|(proto_name, msg)| (NotificationsIn::new(proto_name), msg))
			.collect();

		NotifsHandlerProto {
			in_protocols,
			out_protocols,
			legacy_protocol,
		}
	}
/// Builds a new handler.
///
/// `list` is a list of notification protocols names, and the message to send as part of the
/// handshake. At the moment, the message is always the same whether we open a substream
/// ourselves or respond to handshake from the remote.
///
/// The first protocol in `list` is special-cased as the protocol that contains the handshake
/// to report through the [`NotifsHandlerOut::Open`] event.
///
/// # Panic
///
/// - Panics if `list` is empty.
///
Builds a new handler.
`list` is a list of notification protocols names, and the message to send as part of the
handshake. At the moment, the message is always the same whether we open a substream
ourselves or respond to handshake from the remote.

The first protocol in `list` is special-cased as the protocol that contains the handshake
to report through the [`NotifsHandlerOut::Open`] event.
Builds a new handler . ` list ` is a list of notification protocols names and the message to send as part of the handshake . At the moment the message is always the same whether we open a substream ourselves or respond to handshake from the remote . The first protocol in ` list ` is special - cased as the protocol that contains the handshake to report through the [ ` NotifsHandlerOut :: Open ` ] event .
pub fn new(
		legacy_protocol: RegisteredProtocol,
		list: impl Into<Vec<(Cow<'static, str>, Arc<RwLock<Vec<u8>>>)>>,
	) -> Self {
		let list = list.into();
		assert!(!list.is_empty());
		let out_protocols = list
			.clone()
			.into_iter()
			.collect();
		let in_protocols = list.clone()
			.into_iter()
			.map(|(proto_name, msg)| (NotificationsIn::new(proto_name), msg))
			.collect();
		NotifsHandlerProto {
			in_protocols,
			out_protocols,
			legacy_protocol,
		}
	}
pub fn new ( legacy_protocol : RegisteredProtocol , list : impl Into < Vec < ( Cow < ' static , str > , Arc < RwLock < Vec < u8 > > > ) > > , ) -> Self { let list = list . into ( ) ; assert ! ( list is_empty ( ) ) ; let out_protocols = list . clone ( ) . into_iter ( ) . collect ( ) ; let in_protocols = list . clone ( ) . into_iter ( ) . map ( | ( proto_name , msg ) | ( NotificationsIn :: new ( proto_name ) , msg ) ) . collect ( ) ; NotifsHandlerProto { in_protocols , out_protocols , legacy_protocol , } }
Builds a new handler.
Builds a new handler .
legacy_protocol
RegisteredProtocol
list
impl Into<Vec<(Cow<'static, str>, Arc<RwLock<Vec<u8>>>)>>
legacy_protocol
RegisteredProtocol
list
impl Into<Vec<(Cow<'static, str>, Arc<RwLock<Vec<u8>>>)>>
panic
Panics if `list` is empty.
Panics if ` list ` is empty .