nxtquic_api/
connection.rs1use crate::stream::{RecvStream, SendStream};
4
5pub struct Connection {
7 }
9
10impl Connection {
11 pub(crate) fn new() -> Self {
13 Self {}
14 }
15
16 pub async fn open_bi(&self) -> std::io::Result<(SendStream, RecvStream)> {
18 Ok((SendStream::new(), RecvStream::new()))
19 }
20
21 pub async fn open_uni(&self) -> std::io::Result<SendStream> {
23 Ok(SendStream::new())
24 }
25
26 pub async fn accept_bi(&self) -> std::io::Result<(SendStream, RecvStream)> {
28 Ok((SendStream::new(), RecvStream::new()))
29 }
30
31 pub async fn accept_uni(&self) -> std::io::Result<RecvStream> {
33 Ok(RecvStream::new())
34 }
35
36 pub async fn send_datagram(&self, _data: bytes::Bytes) -> std::io::Result<()> {
38 Ok(())
39 }
40
41 pub async fn close(&self) {
43 }
45}