pub fn new(protocol: impl Into<ProtocolId>, versions: &[u8])
		-> Self {
		let protocol = protocol.into();
		let mut base_name = Bytes::from_static(b"/substrate/");
		base_name.extend_from_slice(protocol.as_bytes());
		base_name.extend_from_slice(b"/");

		RegisteredProtocol {
			base_name,
			id: protocol,
			supported_versions: {
				let mut tmp = versions.to_vec();
				tmp.sort_unstable_by(|a, b| b.cmp(&a));
				tmp
			},
			marker: PhantomData,
		}
	}
/// Creates a new `RegisteredProtocol`. The `custom_data` parameter will be
/// passed inside the `RegisteredProtocolOutput`.
Creates a new `RegisteredProtocol`. The `custom_data` parameter will be
passed inside the `RegisteredProtocolOutput`.
Creates a new ` RegisteredProtocol ` . The ` custom_data ` parameter will be passed inside the ` RegisteredProtocolOutput ` .
pub fn new(protocol: impl Into<ProtocolId>, versions: &[u8])
		-> Self {
		let protocol = protocol.into();
		let mut base_name = Bytes::from_static(b"/substrate/");
		base_name.extend_from_slice(protocol.as_bytes());
		base_name.extend_from_slice(b"/");
		RegisteredProtocol {
			base_name,
			id: protocol,
			supported_versions: {
				let mut tmp = versions.to_vec();
				tmp.sort_unstable_by(|a, b| b.cmp(&a));
				tmp
			},
			marker: PhantomData,
		}
	}
pub fn new ( protocol : impl Into < ProtocolId > , versions : & [ u8 ] ) -> Self { let protocol = protocol . into ( ) ; let mut base_name = Bytes :: from_static ( b" " ) ; base_name . extend_from_slice ( protocol . as_bytes ( ) ) ; base_name . extend_from_slice ( b" " ) ; RegisteredProtocol { base_name , id : protocol , supported_versions : { let mut tmp = versions . to_vec ( ) ; tmp . sort_unstable_by ( | a , b | b . cmp ( & a ) ) ; tmp } , marker : PhantomData , } }
Creates a new `RegisteredProtocol`.
Creates a new ` RegisteredProtocol ` .
protocol
impl Into<ProtocolId>
versions
&[u8]
protocol
impl Into<ProtocolId>
versions
&[u8]