Debian Codegraph @

src/decompress_deflate.rs

raw symbols SCIP
1 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/;
2 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/;
3
4 use flate2rust-analyzer cargo flate2 1.1.9 crate/::readrust-analyzer cargo flate2 1.1.9 read/::DeflateDecoderrust-analyzer cargo flate2 1.1.9 deflate/read/DeflateDecoder#;
5 use flate2rust-analyzer cargo flate2 1.1.9 crate/::readrust-analyzer cargo flate2 1.1.9 read/::ZlibDecoderrust-analyzer cargo flate2 1.1.9 zlib/read/ZlibDecoder#;
6
7 use superrust-analyzer cargo buffered-reader 1.4.1 crate/::*;
8
9 /// Decompresses the underlying `BufferedReader` using the deflate
10 /// algorithm.
11 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
12 pub struct Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> {
13 readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader.: Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#<DeflateDecoderrust-analyzer cargo flate2 1.1.9 deflate/read/DeflateDecoder#<R>, C>,
14 }
15
16 assert_send_and_syncrust-analyzer cargo buffered-reader 1.4.1 macros/assert_send_and_sync!!(Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, C>
17 where R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>,
18 C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#);
19
20 impl <R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<()>> Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, ()> {
21 /// Instantiates a new deflate decompression reader.
22 ///
23 /// `reader` is the source to wrap.
24 pub fn newrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, ()>`]new().(reader: R) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, ()>`] {
25 Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, ()>`]::with_cookierust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`]with_cookie().(reader, ())
26 }
27 }
28
29 impl <R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, C> {
30 /// Like [`Self::new`], but uses a cookie.
31 ///
32 /// The cookie can be retrieved using the [`BufferedReader::cookie_ref`] and
33 /// [`BufferedReader::cookie_mut`] methods, and set using the [`BufferedReader::cookie_set`] method.
34 pub fn with_cookierust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`]with_cookie().(reader: R, cookie: C) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`] {
35 Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate# {
36 readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader.: Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#::with_cookierust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]with_cookie().(
37 DeflateDecoderrust-analyzer cargo flate2 1.1.9 deflate/read/DeflateDecoder#::newrust-analyzer cargo flate2 1.1.9 deflate/read/impl#[`DeflateDecoder<R>`]new().(reader), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, cookie),
38 }
39 }
40 }
41
42 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# for Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, C> {
43 fn readrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][Read]read().(&mut self, buf: &mut [u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<usize, 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#> {
44 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..readrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][Read]read().(buf)
45 }
46 }
47
48 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, C> {
49 fn fmtrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
50 f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Deflate").finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().()
51 }
52 }
53
54 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync#> BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>
55 for Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#<R, C> {
56 fn bufferrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]buffer().(&self) -> &[u8] {
57 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..bufferrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]buffer().()
58 }
59
60 fn datarust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
61 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..datarust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data().(amount)
62 }
63
64 fn data_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data_hard().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
65 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..data_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_hard().(amount)
66 }
67
68 fn data_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data_eof().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
69 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..data_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#data_eof().()
70 }
71
72 fn consumerust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]consume().(&mut self, amount: usize) -> &[u8] {
73 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]consume().(amount)
74 }
75
76 fn data_consumerust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data_consume().(&mut self, amount: usize)
77 -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
78 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..data_consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume().(amount)
79 }
80
81 fn data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data_consume_hard().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
82 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume_hard().(amount)
83 }
84
85 fn read_be_u16rust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]read_be_u16().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<u16, 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#> {
86 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..read_be_u16rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u16().()
87 }
88
89 fn read_be_u32rust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]read_be_u32().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<u32, 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#> {
90 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..read_be_u32rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u32().()
91 }
92
93 fn stealrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]steal().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>, 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#> {
94 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..stealrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal().(amount)
95 }
96
97 fn steal_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]steal_eof().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>, 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#> {
98 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..steal_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal_eof().()
99 }
100
101 fn get_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]get_mut().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&mut dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>> {
102 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..reader_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_mut().().get_mutrust-analyzer cargo flate2 1.1.9 deflate/read/impl#[`DeflateDecoder<R>`]get_mut().())
103 }
104
105 fn get_refrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]get_ref().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>> {
106 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..reader_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_ref().().get_refrust-analyzer cargo flate2 1.1.9 deflate/read/impl#[`DeflateDecoder<R>`]get_ref().())
107 }
108
109 fn into_innerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]into_inner().<'b>(self: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]>)
110 -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C> + 'b>> where Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]: 'b {
111 // Strip the outer box.
112 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..into_readerrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]into_reader().().into_innerrust-analyzer cargo flate2 1.1.9 deflate/read/impl#[`DeflateDecoder<R>`]into_inner().().into_boxedrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#into_boxed().())
113 }
114
115 fn cookie_setrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]cookie_set().(&mut self, cookie: C) -> C {
116 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..cookie_setrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_set().(cookie)
117 }
118
119 fn cookie_refrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]cookie_ref().(&self) -> &C {
120 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..cookie_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_ref().()
121 }
122
123 fn cookie_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]cookie_mut().(&mut self) -> &mut C {
124 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#reader..cookie_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_mut().()
125 }
126 }
127
128 /// Decompresses the underlying `BufferedReader` using the zlib
129 /// algorithm.
130 pub struct Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> {
131 readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader.: Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#<ZlibDecoderrust-analyzer cargo flate2 1.1.9 zlib/read/ZlibDecoder#<R>, C>,
132 }
133
134 assert_send_and_syncrust-analyzer cargo buffered-reader 1.4.1 macros/assert_send_and_sync!!(Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C>
135 where R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>,
136 C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug#);
137
138 impl <R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<()>> Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, ()> {
139 /// Instantiates a new zlib decompression reader.
140 ///
141 /// `reader` is the source to wrap.
142 pub fn newrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, ()>`]new().(reader: R) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, ()>`] {
143 Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, ()>`]::with_cookierust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`]with_cookie().(reader, ())
144 }
145 }
146
147 impl <R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C> {
148 /// Like [`Self::new`], but uses a cookie.
149 ///
150 /// The cookie can be retrieved using the [`BufferedReader::cookie_ref`] and
151 /// [`BufferedReader::cookie_mut`] methods, and set using the [`BufferedReader::cookie_set`] method.
152 pub fn with_cookierust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`]with_cookie().(reader: R, cookie: C) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`] {
153 Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib# {
154 readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader.: Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#::with_cookierust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]with_cookie().(
155 ZlibDecoderrust-analyzer cargo flate2 1.1.9 zlib/read/ZlibDecoder#::newrust-analyzer cargo flate2 1.1.9 zlib/read/impl#[`ZlibDecoder<R>`]new().(reader), Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, cookie),
156 }
157 }
158 }
159
160 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read# for Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C> {
161 fn readrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][Read]read().(&mut self, buf: &mut [u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<usize, 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#> {
162 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..readrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][Read]read().(buf)
163 }
164 }
165
166 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C> {
167 fn fmtrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
168 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "Zlib")
169 }
170 }
171
172 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C> {
173 fn fmtrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][Debug]fmt().(&self, f: &mut fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#) -> fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
174 f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Zlib")
175 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("reader", &self.get_refrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]get_ref().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().())
176 .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().()
177 }
178 }
179
180 impl<R: BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>, C: fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync#> BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>
181 for Zlibrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#<R, C> {
182 fn bufferrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]buffer().(&self) -> &[u8] {
183 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..bufferrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]buffer().()
184 }
185
186 fn datarust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]data().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
187 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..datarust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data().(amount)
188 }
189
190 fn data_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]data_hard().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
191 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..data_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_hard().(amount)
192 }
193
194 fn data_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]data_eof().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
195 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..data_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#data_eof().()
196 }
197
198 fn consumerust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]consume().(&mut self, amount: usize) -> &[u8] {
199 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]consume().(amount)
200 }
201
202 fn data_consumerust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]data_consume().(&mut self, amount: usize)
203 -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
204 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..data_consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume().(amount)
205 }
206
207 fn data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]data_consume_hard().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&[u8], 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#> {
208 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume_hard().(amount)
209 }
210
211 fn read_be_u16rust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]read_be_u16().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<u16, 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#> {
212 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..read_be_u16rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u16().()
213 }
214
215 fn read_be_u32rust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]read_be_u32().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<u32, 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#> {
216 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..read_be_u32rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u32().()
217 }
218
219 fn stealrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]steal().(&mut self, amount: usize) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>, 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#> {
220 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..stealrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal().(amount)
221 }
222
223 fn steal_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]steal_eof().(&mut self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>, 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#> {
224 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..steal_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal_eof().()
225 }
226
227 fn get_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]get_mut().(&mut self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&mut dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>> {
228 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..reader_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_mut().().get_mutrust-analyzer cargo flate2 1.1.9 zlib/read/impl#[`ZlibDecoder<R>`]get_mut().())
229 }
230
231 fn get_refrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]get_ref().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C>> {
232 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..reader_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_ref().().get_refrust-analyzer cargo flate2 1.1.9 zlib/read/impl#[`ZlibDecoder<R>`]get_ref().())
233 }
234
235 fn into_innerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]into_inner().<'b>(self: Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]>)
236 -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn BufferedReaderrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#<C> + 'b>> where Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]: 'b {
237 // Strip the outer box.
238 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..into_readerrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]into_reader().().into_innerrust-analyzer cargo flate2 1.1.9 zlib/read/impl#[`ZlibDecoder<R>`]into_inner().().into_boxedrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#into_boxed().())
239 }
240
241 fn cookie_setrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]cookie_set().(&mut self, cookie: C) -> C {
242 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..cookie_setrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_set().(cookie)
243 }
244
245 fn cookie_refrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]cookie_ref().(&self) -> &C {
246 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..cookie_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_ref().()
247 }
248
249 fn cookie_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Zlib<R, C>`][`BufferedReader<C>`]cookie_mut().(&mut self) -> &mut C {
250 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Zlib#reader..cookie_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_mut().()
251 }
252 }
253
254 #[cfg(test)]
255 mod testrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/test/ {
256 use superrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/::*;
257
258 // Test that buffer() returns the same data as data().
259 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
260 fn buffer_testrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/test/buffer_test().() {
261 use flate2rust-analyzer cargo flate2 1.1.9 crate/::writerust-analyzer cargo flate2 1.1.9 write/::DeflateEncoderrust-analyzer cargo flate2 1.1.9 deflate/write/DeflateEncoder#;
262 use flate2rust-analyzer cargo flate2 1.1.9 crate/::Compressionrust-analyzer cargo flate2 1.1.9 Compression#;
263 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/::preluderust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/prelude/::*;
264
265 // Test vector.
266 let size = 10 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().default_buf_sizerust-analyzer cargo buffered-reader 1.4.1 default_buf_size().();
267 let mut input_raw = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(size);
268 let mut v = 0u8;
269 for _ in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#size {
270 input_raw.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(v);
271 if v rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]eq().stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::u8rust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u8/::MAXrust-analyzer cargo core https://github.com/rust-lang/rust/library/core legacy_int_modules/u8/MAX. {
272 v = 0;
273 } else {
274 v rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[u8][`AddAssign<Self>`]add_assign().1;
275 }
276 }
277
278 // Compress the raw input.
279 let mut input = 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().();
280 {
281 let mut encoder =
282 DeflateEncoderrust-analyzer cargo flate2 1.1.9 deflate/write/DeflateEncoder#::newrust-analyzer cargo flate2 1.1.9 deflate/write/impl#[`DeflateEncoder<W>`]new().(&mut input, Compressionrust-analyzer cargo flate2 1.1.9 Compression#::defaultrust-analyzer cargo flate2 1.1.9 impl#[Compression][Default]default().());
283 encoder.write_allrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#write_all().(&input_raw[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
284 encoder.try_finishrust-analyzer cargo flate2 1.1.9 deflate/write/impl#[`DeflateEncoder<W>`]try_finish().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
285 }
286
287 let mut reader = Deflaterust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/Deflate#::newrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, ()>`]new().(
288 Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#::newrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, ()>`]new().(&input[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()., Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#));
289
290 // Gather some stats to make it easier to figure out whether
291 // this test is working.
292 let stats_count = 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Mul<Self>`]mul().default_buf_sizerust-analyzer cargo buffered-reader 1.4.1 default_buf_size().();
293 let mut stats = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0usize; stats_count];
294
295 for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#input_raw.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() {
296 let data = reader.datarust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]data().(default_buf_sizerust-analyzer cargo buffered-reader 1.4.1 default_buf_size().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().();
297 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().data.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().());
298 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(data, reader.bufferrust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]buffer().());
299 // And, we may as well check to make sure we read the
300 // right data.
301 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(data, &input_raw[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().i..i+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().()]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().);
302
303 stats[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().cmprust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/::minrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/min().(data.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), stats_count rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1)]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1;
304
305 // Consume one byte and see what happens.
306 reader.consumerust-analyzer cargo buffered-reader 1.4.1 decompress_deflate/impl#[`Deflate<R, C>`][`BufferedReader<C>`]consume().(1);
307 }
308
309 if false {
310 for i in 0..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#stats.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() {
311 if stats[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
312 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialEq<Self>`]eq().stats.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1 {
313 eprintrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprint!!(">=");
314 }
315 eprintlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/eprintln!!("{}: {}", i, stats[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().);
316 }
317 }
318 }
319 }
320 }