pub struct OwningServerFilter<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.
This copies the handshake keys so that it is not constrained by the key’s lifetime.
Implementations§
Source§impl<S, FilterFn, AsyncBool> OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> OwningServerFilter<S, FilterFn, AsyncBool>
Sourcepub fn new(
stream: S,
filter_fn: FilterFn,
network_identifier: [u8; 32],
server_longterm_pk: PublicKey,
server_longterm_sk: SecretKey,
server_ephemeral_pk: PublicKey,
server_ephemeral_sk: SecretKey,
) -> OwningServerFilter<S, FilterFn, AsyncBool>
pub fn new( stream: S, filter_fn: FilterFn, network_identifier: [u8; 32], server_longterm_pk: PublicKey, server_longterm_sk: SecretKey, server_ephemeral_pk: PublicKey, server_ephemeral_sk: SecretKey, ) -> OwningServerFilter<S, FilterFn, AsyncBool>
Create a new OwningServerFilter
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.
This copies the handshake keys so that it is not constrained by the key’s lifetime.
Ephemeral keypairs can be generated via
sodiumoxide::crypto::box_::gen_keypair
.
Trait Implementations§
Auto Trait Implementations§
impl<S, FilterFn, AsyncBool> Freeze for OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> RefUnwindSafe for OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> !Send for OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> !Sync for OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> Unpin for OwningServerFilter<S, FilterFn, AsyncBool>
impl<S, FilterFn, AsyncBool> UnwindSafe for OwningServerFilter<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.