Rename SecioConnUpgrade to SecioConfig

This commit is contained in:
Pierre Krieger
2017-12-04 15:50:14 +01:00
parent 33025ba22e
commit 067c0683b5
3 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@ fn main() {
.or_upgrade({
let private_key = include_bytes!("test-private-key.pk8");
let public_key = include_bytes!("test-public-key.der").to_vec();
secio::SecioConnUpgrade {
secio::SecioConfig {
key: secio::SecioKeyPair::rsa_from_pkcs8(private_key, public_key).unwrap(),
}
});

View File

@ -46,7 +46,7 @@ fn main() {
.or_upgrade({
let private_key = include_bytes!("test-private-key.pk8");
let public_key = include_bytes!("test-public-key.der").to_vec();
secio::SecioConnUpgrade {
secio::SecioConfig {
key: secio::SecioKeyPair::rsa_from_pkcs8(private_key, public_key).unwrap(),
}
});

View File

@ -29,7 +29,7 @@
//! `SecioMiddleware` that implements `Sink` and `Stream` and can be used to send packets of data.
//!
//! However for integration with the rest of `libp2p` you are encouraged to use the
//! `SecioConnUpgrade` struct instead. This struct implements the `ConnectionUpgrade` trait and
//! `SecioConfig` struct instead. This struct implements the `ConnectionUpgrade` trait and
//! will automatically apply secio on any incoming or outgoing connection.
extern crate bytes;
@ -68,7 +68,7 @@ mod structs_proto;
/// Implementation of the `ConnectionUpgrade` trait of `libp2p_swarm`. Automatically applies any
/// secio on any connection.
#[derive(Clone)]
pub struct SecioConnUpgrade {
pub struct SecioConfig {
/// Private and public keys of the local node.
pub key: SecioKeyPair,
}
@ -132,7 +132,7 @@ pub enum SecioPublicKey<'a> {
Rsa(&'a [u8]),
}
impl<S> libp2p_swarm::ConnectionUpgrade<S> for SecioConnUpgrade
impl<S> libp2p_swarm::ConnectionUpgrade<S> for SecioConfig
where S: AsyncRead + AsyncWrite + 'static
{
type Output = RwStreamSink<