Struct secret_handshake::ServerHandshakerWithFilter
[−]
[src]
pub struct ServerHandshakerWithFilter<'a, S, FilterFn, AsyncBool>(_, _);
Performs the server side of a handshake. Allows filtering clients based on their longterm public key.
Methods
impl<'a, S, FilterFn, AsyncBool> ServerHandshakerWithFilter<'a, S, FilterFn, AsyncBool> where
S: AsyncRead + AsyncWrite,
FilterFn: FnOnce(&PublicKey) -> AsyncBool,
AsyncBool: Future<Item = bool>,
[src]
S: AsyncRead + AsyncWrite,
FilterFn: FnOnce(&PublicKey) -> AsyncBool,
AsyncBool: Future<Item = bool>,
pub fn new(
stream: S,
filter_fn: FilterFn,
network_identifier: &'a [u8; 32],
server_longterm_pk: &'a PublicKey,
server_longterm_sk: &'a SecretKey,
server_ephemeral_pk: &'a PublicKey,
server_ephemeral_sk: &'a SecretKey
) -> ServerHandshakerWithFilter<'a, S, FilterFn, AsyncBool>
[src]
stream: S,
filter_fn: FilterFn,
network_identifier: &'a [u8; 32],
server_longterm_pk: &'a PublicKey,
server_longterm_sk: &'a SecretKey,
server_ephemeral_pk: &'a PublicKey,
server_ephemeral_sk: &'a SecretKey
) -> ServerHandshakerWithFilter<'a, S, FilterFn, AsyncBool>
Creates a new ServerHandshakerWithFilter to accept a connection from a
client which knows the server's public key and uses the right app key
over the given stream
.
Once the client has revealed its longterm public key, filter_fn
is
invoked. If the returned AsyncBool
resolves to Ok(Ready(false))
,
the handshake is aborted.
Trait Implementations
impl<'a, S, FilterFn, AsyncBool> Future for ServerHandshakerWithFilter<'a, S, FilterFn, AsyncBool> where
S: AsyncRead + AsyncWrite,
FilterFn: FnOnce(&PublicKey) -> AsyncBool,
AsyncBool: Future<Item = bool>,
[src]
S: AsyncRead + AsyncWrite,
FilterFn: FnOnce(&PublicKey) -> AsyncBool,
AsyncBool: Future<Item = bool>,
Future implementation to asynchronously drive a handshake.
type Item = (Outcome, S)
A successful value
type Error = (FilteringHandshakeError<AsyncBool::Error>, S)
An error
fn poll(&mut self, cx: &mut Context) -> Poll<Self::Item, Self::Error>
[src]
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more