pub struct SecureConnection { /* private fields */ }Implementations§
Source§impl SecureConnection
impl SecureConnection
pub fn new(framed: Framed<TcpStream, PacketCodec>, key: [u8; 32]) -> Self
Sourcepub fn with_timeouts(
self,
send_timeout: Duration,
recv_timeout: Duration,
) -> Self
pub fn with_timeouts( self, send_timeout: Duration, recv_timeout: Duration, ) -> Self
Set custom timeout durations
Sourcepub fn time_since_last_activity(&self) -> Duration
pub fn time_since_last_activity(&self) -> Duration
Get the time since the last activity (send or receive)
pub async fn secure_send(&mut self, msg: impl Serialize) -> Result<()>
pub async fn secure_recv<T: DeserializeOwned>(&mut self) -> Result<T>
Auto Trait Implementations§
impl !Freeze for SecureConnection
impl RefUnwindSafe for SecureConnection
impl Send for SecureConnection
impl Sync for SecureConnection
impl Unpin for SecureConnection
impl UnwindSafe for SecureConnection
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