Debian Codegraph @

src/decompress_bzip2.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 bzip2rust-analyzer cargo bzip2 0.6.1 crate/::readrust-analyzer cargo bzip2 0.6.1 read/::BzDecoderrust-analyzer cargo bzip2 0.6.1 read/BzDecoder#;
5
6 use superrust-analyzer cargo buffered-reader 1.4.1 crate/::*;
7
8
9 /// Decompresses the underlying `BufferedReader` using the bzip2
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 Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<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_bzip2/Bzip#reader.: Genericrust-analyzer cargo buffered-reader 1.4.1 generic/Generic#<BzDecoderrust-analyzer cargo bzip2 0.6.1 read/BzDecoder#<R>, C>,
14 }
15
16 assert_send_and_syncrust-analyzer cargo buffered-reader 1.4.1 macros/assert_send_and_sync!!(Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<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#<()>> Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<R, ()> {
21 /// Instantiates a new bzip decompression reader.
22 ///
23 /// `reader` is the source to wrap.
24 pub fn newrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, ()>`]new().(reader: R) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, ()>`] {
25 Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, ()>`]::with_cookierust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<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_bzip2/impl#[`Bzip<R, C>`]with_cookie().(reader: R, cookie: C) -> Selfrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`] {
35 Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip# {
36 readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#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 BzDecoderrust-analyzer cargo bzip2 0.6.1 read/BzDecoder#::newrust-analyzer cargo bzip2 0.6.1 read/impl#[`BzDecoder<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 Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<R, C> {
43 fn readrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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_bzip2/Bzip#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 Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<R, C> {
49 fn fmtrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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().("Bzip").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> for Bziprust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#<R, C> {
55 fn bufferrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]buffer().(&self) -> &[u8] {
56 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..bufferrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]buffer().()
57 }
58
59 fn datarust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
60 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..datarust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data().(amount)
61 }
62
63 fn data_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
64 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..data_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_hard().(amount)
65 }
66
67 fn data_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
68 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..data_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#data_eof().()
69 }
70
71 fn consumerust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]consume().(&mut self, amount: usize) -> &[u8] {
72 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]consume().(amount)
73 }
74
75 fn data_consumerust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]data_consume().(&mut self, amount: usize)
76 -> 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#> {
77 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..data_consumerust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume().(amount)
78 }
79
80 fn data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
81 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..data_consume_hardrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]data_consume_hard().(amount)
82 }
83
84 fn read_be_u16rust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
85 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..read_be_u16rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u16().()
86 }
87
88 fn read_be_u32rust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
89 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..read_be_u32rust-analyzer cargo buffered-reader 1.4.1 BufferedReader#read_be_u32().()
90 }
91
92 fn stealrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
93 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..stealrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal().(amount)
94 }
95
96 fn steal_eofrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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#> {
97 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..steal_eofrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#steal_eof().()
98 }
99
100 fn get_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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>> {
101 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_bzip2/Bzip#reader..reader_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_mut().().get_mutrust-analyzer cargo bzip2 0.6.1 read/impl#[`BzDecoder<R>`]get_mut().())
102 }
103
104 fn get_refrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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>> {
105 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_bzip2/Bzip#reader..reader_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]reader_ref().().get_refrust-analyzer cargo bzip2 0.6.1 read/impl#[`BzDecoder<R>`]get_ref().())
106 }
107
108 fn into_innerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<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_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]>)
109 -> 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_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]: 'b {
110 // Strip the outer box.
111 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_bzip2/Bzip#reader..into_readerrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`]into_reader().().into_innerrust-analyzer cargo bzip2 0.6.1 read/impl#[`BzDecoder<R>`]into_inner().().into_boxedrust-analyzer cargo buffered-reader 1.4.1 BufferedReader#into_boxed().())
112 }
113
114 fn cookie_setrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]cookie_set().(&mut self, cookie: C) -> C {
115 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..cookie_setrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_set().(cookie)
116 }
117
118 fn cookie_refrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]cookie_ref().(&self) -> &C {
119 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..cookie_refrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_ref().()
120 }
121
122 fn cookie_mutrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/impl#[`Bzip<R, C>`][`BufferedReader<C>`]cookie_mut().(&mut self) -> &mut C {
123 self.readerrust-analyzer cargo buffered-reader 1.4.1 decompress_bzip2/Bzip#reader..cookie_mutrust-analyzer cargo buffered-reader 1.4.1 generic/impl#[`Generic<T, C>`][`BufferedReader<C>`]cookie_mut().()
124 }
125 }