Skip to main content

asimov_protocol/
peer_connection_state.rs

1// This is free and unencumbered software released into the public domain.
2
3#![allow(dead_code)]
4
5use crate::PeerHello;
6use iroh::endpoint::{Connection, RecvStream, SendStream};
7
8/// The transport layer (QUIC) has completed its handshake.
9#[derive(Debug)]
10pub struct Connected {
11    pub(crate) inner: Connection,
12}
13
14/// The hello request has been sent.
15#[derive(Debug)]
16pub struct Negotiating {
17    pub(crate) inner: Connection,
18    pub(crate) send: SendStream,
19    pub(crate) recv: RecvStream,
20}
21
22/// The hello response has been received.
23#[derive(Debug)]
24pub struct Ready {
25    pub(crate) inner: Connection,
26    pub(crate) send: SendStream,
27    pub(crate) recv: RecvStream,
28    pub(crate) hello: PeerHello,
29}
30
31/// The connection has been closed.
32#[derive(Debug)]
33pub struct Closed {
34    pub(crate) inner: Connection,
35}