pub struct ServerFilter<'a, S, FilterFn, AsyncBool>(/* private fields */);
Expand description
A future that accepts a secret-handshake based on a filter function and then yields a channel that encrypts/decrypts all data via box-stream.
Implementations§
Source§impl<'a, S, FilterFn, AsyncBool> ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> ServerFilter<'a, S, FilterFn, AsyncBool>
Sourcepub 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,
) -> ServerFilter<'a, S, FilterFn, AsyncBool>
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, ) -> ServerFilter<'a, S, FilterFn, AsyncBool>
Create a new ServerFilter
to accept a connection from a client which knows
the server’s public key, uses the right app key over the given stream
and whose longterm public key is accepted by the filter function.
Ephemeral keypairs can be generated via
sodiumoxide::crypto::box_::gen_keypair
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S, FilterFn, AsyncBool> Freeze for ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> RefUnwindSafe for ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> !Send for ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> !Sync for ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> Unpin for ServerFilter<'a, S, FilterFn, AsyncBool>
impl<'a, S, FilterFn, AsyncBool> UnwindSafe for ServerFilter<'a, S, FilterFn, AsyncBool>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§fn into_future(self) -> F
fn into_future(self) -> F
Consumes this object and produces a future.