pub struct NoiseCryptoProvider {
crypto_state_guard: Mutex<()>,
}Expand description
A CryptoProvider that encrypts IPC traffic using the Noise protocol.
Fields§
§crypto_state_guard: Mutex<()>Serializes access to the persisted transport state, so that two concurrent sends cannot read the same copy and reuse a nonce.
Held per provider, and so per IpcClientImpl, rather than per
process: the state it protects belongs to one client’s session repository, and a
process-wide lock would let one client’s handshake — which can wait
HANDSHAKE_TIMEOUT_SECS for a reply — stall every other client’s traffic.
Implementations§
Source§impl NoiseCryptoProvider
impl NoiseCryptoProvider
async fn perform_handshake<Com, Ses>( communication: &Com, sessions: &Ses, destination: Endpoint, ) -> Result<(), NoiseCryptoProviderError>
Trait Implementations§
Source§impl<Com, Ses> CryptoProvider<Com, Ses> for NoiseCryptoProvider
impl<Com, Ses> CryptoProvider<Com, Ses> for NoiseCryptoProvider
type Session = NoiseCryptoProviderState
type SendError = NoiseCryptoProviderError
type ReceiveError = NoiseCryptoProviderError
Source§async fn send(
&self,
communication: &Com,
sessions: &Ses,
message: OutgoingMessage,
) -> Result<(), Self::SendError>
async fn send( &self, communication: &Com, sessions: &Ses, message: OutgoingMessage, ) -> Result<(), Self::SendError>
Send a message. Read more
Source§async fn receive(
&self,
receiver: &Com::Receiver,
communication: &Com,
sessions: &Ses,
) -> Result<IncomingMessage, Self::ReceiveError>
async fn receive( &self, receiver: &Com::Receiver, communication: &Com, sessions: &Ses, ) -> Result<IncomingMessage, Self::ReceiveError>
Receive a message. Read more
Source§impl Default for NoiseCryptoProvider
impl Default for NoiseCryptoProvider
Source§fn default() -> NoiseCryptoProvider
fn default() -> NoiseCryptoProvider
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for NoiseCryptoProvider
impl !RefUnwindSafe for NoiseCryptoProvider
impl Send for NoiseCryptoProvider
impl Sync for NoiseCryptoProvider
impl Unpin for NoiseCryptoProvider
impl UnsafeUnpin for NoiseCryptoProvider
impl UnwindSafe for NoiseCryptoProvider
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more