pub struct PassthroughChannel { /* private fields */ }Expand description
Passthrough “encryption” for testing and development.
No actual crypto — plaintext passes through unchanged.
Use NoiseChannel for production deployments.
Implementations§
Source§impl PassthroughChannel
impl PassthroughChannel
Sourcepub fn new(stream: Box<dyn MeshStream>) -> Self
pub fn new(stream: Box<dyn MeshStream>) -> Self
Wrap a raw stream with passthrough (no-op) encryption.
Trait Implementations§
Source§impl EncryptedChannel for PassthroughChannel
impl EncryptedChannel for PassthroughChannel
Source§fn send_encrypted<'life0, 'life1, 'async_trait>(
&'life0 mut self,
plaintext: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_encrypted<'life0, 'life1, 'async_trait>(
&'life0 mut self,
plaintext: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send encrypted data (plaintext in, ciphertext on the wire).
Source§fn recv_encrypted<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv_encrypted<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive and decrypt data (ciphertext from wire, plaintext out). Read more
Source§fn remote_static_key(&self) -> Option<&[u8]>
fn remote_static_key(&self) -> Option<&[u8]>
Get the remote peer’s static public key (after handshake).
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MeshError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the encrypted channel gracefully.
Source§fn handshake_hash(&self) -> Option<&[u8]>
fn handshake_hash(&self) -> Option<&[u8]>
The Noise handshake hash of this session, when the channel has
one. Both sides of a session compute the same value; admission
signs it to bind a node identity to this exact session (P3-K1).
None for channels without a handshake (plaintext passthrough).Auto Trait Implementations§
impl !RefUnwindSafe for PassthroughChannel
impl !UnwindSafe for PassthroughChannel
impl Freeze for PassthroughChannel
impl Send for PassthroughChannel
impl Sync for PassthroughChannel
impl Unpin for PassthroughChannel
impl UnsafeUnpin for PassthroughChannel
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 more