aquatic_http: add Connection methods, enabling making 'inner' private

This commit is contained in:
Joakim Frostegård 2020-07-04 13:35:52 +02:00
parent 1ea1f0b749
commit c28e764929
2 changed files with 28 additions and 8 deletions

View file

@ -252,18 +252,18 @@ pub fn run_handshakes_and_read_requests(
{
match handshake_machine.establish_tls(){
Ok(established) => {
let connection = Connection {
let connection = Connection::from_established(
valid_until,
inner: ConnectionInner::Established(established)
};
established
);
connections.insert(poll_token, connection);
},
Err(TlsHandshakeMachineError::WouldBlock(machine)) => {
let connection = Connection {
let connection = Connection::from_in_progress(
valid_until,
inner: ConnectionInner::InProgress(machine)
};
machine
);
connections.insert(poll_token, connection);