| 1 |
use superrust-analyzer cargo async-tls 0.13.0 rusttls/stream/::Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#; |
| 2 |
use futures_executorrust-analyzer cargo futures-executor 0.3.34 crate/::block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().; |
| 3 |
use futures_iorust-analyzer cargo futures-io 0.3.34 crate/::{AsyncReadrust-analyzer cargo futures-io 0.3.34 if_std/AsyncRead#, AsyncWriterust-analyzer cargo futures-io 0.3.34 if_std/AsyncWrite#}; |
| 4 |
use futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::iorust-analyzer cargo futures-util 0.3.34 io/::{AsyncReadExtrust-analyzer cargo futures-util 0.3.34 io/AsyncReadExt#, AsyncWriteExtrust-analyzer cargo futures-util 0.3.34 io/AsyncWriteExt#}; |
| 5 |
use futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::taskrust-analyzer cargo futures-util 0.3.34 task/::{noop_waker_refrust-analyzer cargo futures-task 0.3.34 noop_waker/noop_waker_ref()., Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#}; |
| 6 |
use futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::{futurerust-analyzer cargo futures-util 0.3.34 future/, readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!}; |
| •7 |
use rustlsrust-analyzer cargo rustls 0.23.43 crate/::pki_typesrust-analyzer cargo rustls 0.23.43 pki_types/::{PrivateKeyDerrust-analyzer cargo rustls-pki-types 1.15.1 PrivateKeyDer#, ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#}; |
| 8 |
use rustlsrust-analyzer cargo rustls 0.23.43 crate/::{ |
| •9 |
ClientConfigrust-analyzer cargo rustls 0.23.43 client/client_conn/ClientConfig#, ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#, ConnectionCommonrust-analyzer cargo rustls 0.23.43 conn/ConnectionCommon#, RootCertStorerust-analyzer cargo rustls 0.23.43 webpki/anchors/RootCertStore#, |
| 10 |
ServerConfigrust-analyzer cargo rustls 0.23.43 server/server_conn/ServerConfig#, ServerConnectionrust-analyzer cargo rustls 0.23.43 server/server_conn/connection/ServerConnection#, |
| 11 |
}; |
| 12 |
use rustls_pemfilerust-analyzer cargo rustls-pemfile 2.2.0 crate/::{certsrust-analyzer cargo rustls-pemfile 2.2.0 certs()., pkcs8_private_keysrust-analyzer cargo rustls-pemfile 2.2.0 pkcs8_private_keys().}; |
| 13 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::convertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/::TryFromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/TryFrom#; |
| 14 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{selfrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/, BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#, Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#, Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#}; |
| 15 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/::Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#; |
| 16 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#; |
| 17 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::taskrust-analyzer cargo std https://github.com/rust-lang/rust/library/std task/::Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#; |
| 18 |
|
| 19 |
struct Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#<'a, D>(&'a mut ConnectionCommonrust-analyzer cargo rustls 0.23.43 conn/ConnectionCommon#<D>); |
| 20 |
|
| 21 |
impl<'a, D> AsyncReadrust-analyzer cargo futures-io 0.3.34 if_std/AsyncRead# for Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#<'a, D> { |
| 22 |
fn poll_readrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncRead]poll_read().( |
| 23 |
mut self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncRead]>, |
| 24 |
_cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>, |
| 25 |
mut buf: &mut [u8], |
| 26 |
) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize>> { |
| 27 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#0..write_tlsrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]write_tls().(buf.by_refrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#by_ref().())) |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
impl<'a, D> AsyncWriterust-analyzer cargo futures-io 0.3.34 if_std/AsyncWrite# for Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#<'a, D> { |
| 32 |
fn poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]poll_write().( |
| 33 |
mut self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]>, |
| 34 |
_cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>, |
| 35 |
mut buf: &[u8], |
| 36 |
) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize>> { |
| 37 |
let len = self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#0..read_tlsrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]read_tls().(buf.by_refrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#by_ref().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 38 |
self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#0. |
| 39 |
.process_new_packetsrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]process_new_packets().() |
| 40 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|err| iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidDatarust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidData#, err))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 41 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(len)) |
| 42 |
} |
| 43 |
|
| 44 |
fn poll_flushrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]poll_flush().(mut self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]>, _cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 45 |
self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#0. |
| 46 |
.process_new_packetsrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]process_new_packets().() |
| 47 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|err| iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidDatarust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidData#, err))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 48 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())) |
| 49 |
} |
| 50 |
|
| 51 |
fn poll_closerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]poll_close().(mut self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]>, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 52 |
self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#0..send_close_notifyrust-analyzer cargo rustls 0.23.43 common_state/impl#[CommonState]send_close_notify().(); |
| 53 |
self.poll_flushrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[`Good<'a, D>`][AsyncWrite]poll_flush().(cx) |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
struct Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad#(bool); |
| 58 |
|
| 59 |
impl AsyncReadrust-analyzer cargo futures-io 0.3.34 if_std/AsyncRead# for Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad# { |
| 60 |
fn poll_readrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncRead]poll_read().( |
| 61 |
self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncRead]>, |
| 62 |
_cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>, |
| 63 |
_: &mut [u8], |
| 64 |
) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize>> { |
| 65 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(0)) |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
impl AsyncWriterust-analyzer cargo futures-io 0.3.34 if_std/AsyncWrite# for Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad# { |
| 70 |
fn poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]poll_write().( |
| 71 |
self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]>, |
| 72 |
_cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>, |
| 73 |
buf: &[u8], |
| 74 |
) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize>> { |
| 75 |
if self.0rust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad#0. { |
| 76 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Pendingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Pending# |
| 77 |
} else { |
| 78 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(buf.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().())) |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
fn poll_flushrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]poll_flush().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]>, _cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 83 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())) |
| 84 |
} |
| 85 |
|
| 86 |
fn poll_closerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]poll_close().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut Selfrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/impl#[Bad][AsyncWrite]>, _cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 87 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())) |
| 88 |
} |
| 89 |
} |
| 90 |
|
| 91 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 92 |
fn stream_goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/stream_good().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 93 |
block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().(_stream_goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/_stream_good().()) |
| 94 |
} |
| 95 |
|
| 96 |
async fn _stream_goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/_stream_good().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 97 |
const FILErust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/FILE.: &[u8] = include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("../../README.md"); |
| 98 |
let (mut server, mut client) = make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().(); |
| 99 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| do_handshakerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/do_handshake().(&mut client, &mut server, cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 100 |
iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::copyrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/copy/copy().(&mut Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(FILErust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/FILE.), &mut server.writerrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]writer().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 101 |
server.send_close_notifyrust-analyzer cargo rustls 0.23.43 common_state/impl#[CommonState]send_close_notify().(); |
| 102 |
|
| 103 |
{ |
| 104 |
let mut good = Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#(&mut server); |
| 105 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut good, &mut client); |
| 106 |
|
| 107 |
let mut buf = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 108 |
stream.read_to_endrust-analyzer cargo futures-util 0.3.34 io/AsyncReadExt#read_to_end().(&mut buf).rust-analyzer cargo futures-util 0.3.34 io/read_to_end/impl#[`ReadToEnd<'_, A>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 io/read_to_end/impl#[`ReadToEnd<'_, A>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 109 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, FILErust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/FILE.); |
| 110 |
stream.write_allrust-analyzer cargo futures-util 0.3.34 io/AsyncWriteExt#write_all().(b"Hello World!").rust-analyzer cargo futures-util 0.3.34 io/write_all/impl#[`WriteAll<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 io/write_all/impl#[`WriteAll<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 111 |
stream.connrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#conn..send_close_notifyrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Conn<'_>`]send_close_notify().(); |
| 112 |
stream.closerust-analyzer cargo futures-util 0.3.34 io/AsyncWriteExt#close().().rust-analyzer cargo futures-util 0.3.34 io/close/impl#[`Close<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 io/close/impl#[`Close<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 113 |
} |
| 114 |
|
| 115 |
let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 116 |
server.readerrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]reader().().read_to_stringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#read_to_string().(&mut buf)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 117 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello World!"); |
| 118 |
|
| 119 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) as iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> |
| 120 |
} |
| 121 |
|
| 122 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 123 |
fn stream_badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/stream_bad().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 124 |
let fut = async { |
| 125 |
let (mut server, mut client) = make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().(); |
| 126 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| do_handshakerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/do_handshake().(&mut client, &mut server, cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 127 |
client.set_buffer_limitrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]set_buffer_limit().(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(1024)); |
| 128 |
|
| 129 |
let mut bad = Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad#(true); |
| 130 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut bad, &mut client); |
| 131 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 132 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| stream.as_mut_pinrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]as_mut_pin().().poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`][AsyncWrite]poll_write().(cx, &[0x42; 8])).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 133 |
8 |
| 134 |
); |
| 135 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 136 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| stream.as_mut_pinrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]as_mut_pin().().poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`][AsyncWrite]poll_write().(cx, &[0x42; 8])).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 137 |
8 |
| 138 |
); |
| 139 |
let r = futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| stream.as_mut_pinrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]as_mut_pin().().poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`][AsyncWrite]poll_write().(cx, &[0x00; 1024])).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; // fill buffer |
| 140 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). 1024); |
| 141 |
|
| 142 |
let mut cx = Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#::from_wakerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/impl#[`Context<'a>`]from_waker().(noop_waker_refrust-analyzer cargo futures-task 0.3.34 noop_waker/noop_waker_ref().()); |
| 143 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(stream |
| 144 |
.as_mut_pinrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]as_mut_pin().() |
| 145 |
.poll_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`][AsyncWrite]poll_write().(&mut cx, &[0x01]) |
| 146 |
.is_pendingrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/impl#[`Poll<T>`]is_pending().()); |
| 147 |
|
| 148 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) as iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> |
| 149 |
}; |
| 150 |
|
| 151 |
block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().(fut) |
| 152 |
} |
| 153 |
|
| 154 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 155 |
fn stream_handshakerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/stream_handshake().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 156 |
let fut = async { |
| 157 |
let (mut server, mut client) = make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().(); |
| 158 |
|
| 159 |
{ |
| 160 |
let mut good = Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#(&mut server); |
| 161 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut good, &mut client); |
| 162 |
let (r, w) = futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| stream.complete_iorust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]complete_io().(cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 163 |
|
| 164 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(r >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). 0); |
| 165 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(w >rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). 0); |
| 166 |
|
| 167 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| stream.complete_iorust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]complete_io().(cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; // finish server handshake |
| 168 |
} |
| 169 |
|
| 170 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().server.is_handshakingrust-analyzer cargo rustls 0.23.43 common_state/impl#[CommonState]is_handshaking().()); |
| 171 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().client.is_handshakingrust-analyzer cargo rustls 0.23.43 common_state/impl#[CommonState]is_handshaking().()); |
| 172 |
|
| 173 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) as iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> |
| 174 |
}; |
| 175 |
|
| 176 |
block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().(fut) |
| 177 |
} |
| 178 |
|
| 179 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 180 |
fn stream_handshake_eofrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/stream_handshake_eof().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 181 |
let fut = async { |
| 182 |
let (_, mut client) = make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().(); |
| 183 |
|
| 184 |
let mut bad = Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad#(false); |
| 185 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut bad, &mut client); |
| 186 |
|
| 187 |
let mut cx = Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#::from_wakerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/impl#[`Context<'a>`]from_waker().(noop_waker_refrust-analyzer cargo futures-task 0.3.34 noop_waker/noop_waker_ref().()); |
| 188 |
let r = stream.complete_iorust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]complete_io().(&mut cx); |
| 189 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 190 |
r.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/impl#[`Poll<Result<T, E>>`]map_err().(|err| err.kindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]kind().()), |
| 191 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::UnexpectedEofrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#UnexpectedEof#)) |
| 192 |
); |
| 193 |
|
| 194 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) as iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> |
| 195 |
}; |
| 196 |
|
| 197 |
block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().(fut) |
| 198 |
} |
| 199 |
|
| 200 |
#[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 201 |
fn stream_eofrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/stream_eof().() -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 202 |
let fut = async { |
| 203 |
let (mut server, mut client) = make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().(); |
| 204 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| do_handshakerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/do_handshake().(&mut client, &mut server, cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 205 |
|
| 206 |
let mut eof_stream = Badrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Bad#(false); |
| 207 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut eof_stream, &mut client); |
| 208 |
|
| 209 |
let mut buf = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(); |
| 210 |
let res = stream.read_to_endrust-analyzer cargo futures-util 0.3.34 io/AsyncReadExt#read_to_end().(&mut buf).rust-analyzer cargo futures-util 0.3.34 io/read_to_end/impl#[`ReadToEnd<'_, A>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 io/read_to_end/impl#[`ReadToEnd<'_, A>`][Future]poll().; |
| 211 |
assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!( |
| 212 |
res.errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]err().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]map().(|e| e.kindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]kind().()), |
| 213 |
Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::UnexpectedEofrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#UnexpectedEof#) |
| 214 |
); |
| 215 |
|
| 216 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) as iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> |
| 217 |
}; |
| 218 |
|
| 219 |
block_onrust-analyzer cargo futures-executor 0.3.34 local_pool/block_on().(fut) |
| 220 |
} |
| 221 |
|
| 222 |
fn make_pairrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/make_pair().() -> (ServerConnectionrust-analyzer cargo rustls 0.23.43 server/server_conn/connection/ServerConnection#, ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#) { |
| 223 |
const CERTrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/CERT.: &str = include_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_str!!("../../tests/end.cert"); |
| 224 |
const CHAINrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/CHAIN.: &str = include_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_str!!("../../tests/end.chain"); |
| 225 |
const RSArust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/RSA.: &str = include_strrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_str!!("../../tests/end.rsa"); |
| 226 |
|
| •227 |
let cert = certsrust-analyzer cargo rustls-pemfile 2.2.0 certs().(&mut BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(CERTrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/CERT.))).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(); |
| 228 |
let mut keys = pkcs8_private_keysrust-analyzer cargo rustls-pemfile 2.2.0 pkcs8_private_keys().(&mut BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(RSArust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/RSA.))).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(); |
| 229 |
let key = PrivateKeyDerrust-analyzer cargo rustls-pki-types 1.15.1 PrivateKeyDer#::fromrust-analyzer cargo rustls-pki-types 1.15.1 impl#[`PrivateKeyDer<'a>`][`From<PrivatePkcs8KeyDer<'a>>`]from().(keys.poprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]pop().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()); |
| 230 |
let sconfig = ServerConfigrust-analyzer cargo rustls 0.23.43 server/server_conn/ServerConfig#::builderrust-analyzer cargo rustls 0.23.43 server/server_conn/impl#[ServerConfig]builder().() |
| 231 |
.with_no_client_authrust-analyzer cargo rustls 0.23.43 server/builder/impl#[`ConfigBuilder<ServerConfig, WantsVerifier>`]with_no_client_auth().() |
| 232 |
.with_single_certrust-analyzer cargo rustls 0.23.43 server/builder/impl#[`ConfigBuilder<ServerConfig, WantsServerCert>`]with_single_cert().(cert, key) |
| 233 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 234 |
let server = ServerConnectionrust-analyzer cargo rustls 0.23.43 server/server_conn/connection/ServerConnection#::newrust-analyzer cargo rustls 0.23.43 server/server_conn/connection/impl#[ServerConnection]new().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(sconfig)); |
| 235 |
|
| 236 |
let domain = ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#::try_fromrust-analyzer cargo rustls-pki-types 1.15.1 server_name/impl#[`ServerName<'a>`][`TryFrom<&'a str>`]try_from().("localhost").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 237 |
let mut root_store = RootCertStorerust-analyzer cargo rustls 0.23.43 webpki/anchors/RootCertStore#::emptyrust-analyzer cargo rustls 0.23.43 webpki/anchors/impl#[RootCertStore]empty().(); |
| •238 |
let chain = certsrust-analyzer cargo rustls-pemfile 2.2.0 certs().(&mut BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(CHAINrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/CHAIN.))).maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|c| c.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()).collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>(); |
| 239 |
let (added, ignored) = root_store.add_parsable_certificatesrust-analyzer cargo rustls 0.23.43 webpki/anchors/impl#[RootCertStore]add_parsable_certificates().(chain); |
| 240 |
assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(added >= 1 && ignored == 0); |
| 241 |
let cconfig = ClientConfigrust-analyzer cargo rustls 0.23.43 client/client_conn/ClientConfig#::builderrust-analyzer cargo rustls 0.23.43 client/client_conn/impl#[ClientConfig]builder().() |
| 242 |
.with_root_certificatesrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]with_root_certificates().(root_store) |
| 243 |
.with_no_client_authrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_no_client_auth().(); |
| 244 |
let client = ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#::newrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/impl#[ClientConnection]new().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(cconfig), domain); |
| 245 |
|
| 246 |
(server.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(), client.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()) |
| 247 |
} |
| 248 |
|
| 249 |
fn do_handshakerust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/do_handshake().( |
| 250 |
client: &mut ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#, |
| 251 |
server: &mut ServerConnectionrust-analyzer cargo rustls 0.23.43 server/server_conn/connection/ServerConnection#, |
| 252 |
cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>, |
| 253 |
) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 254 |
let mut good = Goodrust-analyzer cargo async-tls 0.13.0 rusttls/stream/test_stream/Good#(server); |
| 255 |
let mut stream = Streamrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#::newrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]new().(&mut good, client); |
| 256 |
|
| 257 |
if stream.connrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#conn..is_handshakingrust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Conn<'_>`]is_handshaking().() { |
| 258 |
readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!!(stream.complete_iorust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]complete_io().(cx))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 259 |
} |
| 260 |
|
| 261 |
if stream.connrust-analyzer cargo async-tls 0.13.0 rusttls/stream/Stream#conn..wants_writerust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Conn<'_>`]wants_write().() { |
| 262 |
readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!!(stream.complete_iorust-analyzer cargo async-tls 0.13.0 rusttls/stream/impl#[`Stream<'a, IO>`]complete_io().(cx))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 263 |
} |
| 264 |
|
| 265 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())) |
| 266 |
} |