Merge pull request #73 from dbcfd/expose-machine

Tokio-Tungstenite Async Changes
pull/74/head
Daniel Abramov 5 years ago committed by GitHub
commit 2b2e663264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/client.rs
  2. 10
      src/handshake/mod.rs

@ -46,8 +46,8 @@ mod encryption {
mod encryption {
use std::net::TcpStream;
use error::{Error, Result};
use stream::Mode;
use crate::error::{Error, Result};
use crate::stream::Mode;
/// TLS support is nod compiled in, this is just standard `TcpStream`.
pub type AutoStream = TcpStream;

@ -24,6 +24,16 @@ pub struct MidHandshake<Role: HandshakeRole> {
}
impl<Role: HandshakeRole> MidHandshake<Role> {
/// Allow access to machine
pub fn get_ref(&self) -> &HandshakeMachine<Role::InternalStream> {
&self.machine
}
/// Allow mutable access to machine
pub fn get_mut(&mut self) -> &mut HandshakeMachine<Role::InternalStream> {
&mut self.machine
}
/// Restarts the handshake process.
pub fn handshake(mut self) -> Result<Role::FinalResult, HandshakeError<Role>> {
let mut mach = self.machine;

Loading…
Cancel
Save