Debian Codegraph @

src/iterators/files.rs

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::cellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/::OnceCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/OnceCell#;
2
3 use cxxrust-analyzer cargo cxx 1.0.199 crate/::UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#;
4
5 use craterust-analyzer cargo rust-apt 0.8.0 crate/::rawrust-analyzer cargo rust-apt 0.8.0 raw/::{IndexFilerust-analyzer cargo rust-apt 0.8.0 records/raw/IndexFile#, PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#, VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#};
6 use craterust-analyzer cargo rust-apt 0.8.0 crate/::{Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, PackageRecordsrust-analyzer cargo rust-apt 0.8.0 records/PackageRecords#};
7
8 /// Associates a version with a PackageFile
9 ///
10 /// This allows a full description of all Versions in all files
11 pub struct VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a> {
12 pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#ptr.: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#>,
13 cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#cache.: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#,
14 }
15
16 impl<'a> VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a> {
17 pub fn newrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`VersionFile<'a>`]new().(ptr: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#>, cache: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#) -> VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a> {
18 VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile# { ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#ptr., cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#cache. }
19 }
20
21 /// Return the PkgRecords Parser for the VersionFile
22 pub fn lookuprust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`VersionFile<'a>`]lookup().(&self) -> &PackageRecordsrust-analyzer cargo rust-apt 0.8.0 records/PackageRecords# { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#cache..recordsrust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]records().().ver_lookuprust-analyzer cargo rust-apt 0.8.0 records/impl#[PackageRecords]ver_lookup().(&self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#ptr.) }
23
24 /// Return the PackageFile for this VersionFile
25 pub fn package_filerust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`VersionFile<'a>`]package_file().(&self) -> PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a> {
26 PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#::newrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]new().(unsafe { self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#ptr..package_filerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]package_file().() }, self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#cache.)
27 }
28 }
29
30 /// Stores information about the files used to generate the cache
31 ///
32 /// Package files are referenced by Version structures to be able to know
33 /// after which Packages file includes this Version.
34 pub struct PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a> {
35 pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#ptr.: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#>,
36 cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#cache.: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#,
37 indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#index.: OnceCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/OnceCell#<UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<IndexFilerust-analyzer cargo rust-apt 0.8.0 records/raw/IndexFile#>>,
38 }
39
40 impl<'a> PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a> {
41 pub fn newrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]new().(ptr: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#>, cache: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#) -> PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile# {
42 PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile# {
43 ptrrust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#ptr.,
44 cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#cache.,
45 indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#index.: OnceCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/OnceCell#::newrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/impl#[`OnceCell<T>`]new().(),
46 }
47 }
48
49 pub fn index_filerust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]index_file().(&self) -> &IndexFilerust-analyzer cargo rust-apt 0.8.0 records/raw/IndexFile# {
50 self.indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#index.
51 .get_or_initrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/impl#[`OnceCell<T>`]get_or_init().(|| unsafe { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#cache..find_indexrust-analyzer cargo rust-apt 0.8.0 cache/raw/impl#[PkgCacheFile]find_index().(self) })
52 }
53 }
54
55 cxx_convert_resultrust-analyzer cargo rust-apt 0.8.0 macros/cxx_convert_result!!(
56 PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#,
57 /// The path to the PackageFile
58 filenamerust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]filename().() -> &str,
59 /// The Archive of the PackageFile. ex: unstable
60 archiverust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]archive().() -> &str,
61 /// The Origin of the PackageFile. ex: Debian
62 originrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]origin().() -> &str,
63 /// The Codename of the PackageFile. ex: main, non-free
64 codenamerust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]codename().() -> &str,
65 /// The Label of the PackageFile. ex: Debian
66 labelrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]label().() -> &str,
67 /// The Hostname of the PackageFile. ex: deb.debian.org
68 siterust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]site().() -> &str,
69 /// The Component of the PackageFile. ex: sid
70 componentrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]component().() -> &str,
71 /// The Architecture of the PackageFile. ex: amd64
72 archrust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]arch().() -> &str,
73 /// The Index Type of the PackageFile. Known values are:
74 ///
75 /// Debian Package Index, Debian Translation Index
76 /// and Debian dpkg status file,
77 index_typerust-analyzer cargo rust-apt 0.8.0 iterators/files/impl#[`PackageFile<'a>`]index_type().() -> &str,
78 );
79
80 #[cxxrust-analyzer cargo cxx 1.0.199 crate/::bridgerust-analyzer cargo cxxbridge-macro 1.0.199 bridge:]
81 pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) mod rawrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/ {
82 unsafe extern "C++" {
83 includerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include!!("rust-apt/apt-pkg-c/package.h");
84
85 type VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#;
86 type DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#;
87 type PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#;
88
89 /// The path to the PackageFile
90 pub fn filenamerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]filename().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
91
92 /// The Archive of the PackageFile. ex: unstable
93 pub fn archiverust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]archive().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
94
95 /// The Origin of the PackageFile. ex: Debian
96 pub fn originrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]origin().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
97
98 /// The Codename of the PackageFile. ex: main, non-free
99 pub fn codenamerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]codename().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
100
101 /// The Label of the PackageFile. ex: Debian
102 pub fn labelrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]label().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
103
104 /// The Hostname of the PackageFile. ex: deb.debian.org
105 pub fn siterust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]site().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
106
107 /// The Component of the PackageFile. ex: sid
108 pub fn componentrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]component().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
109
110 /// The Architecture of the PackageFile. ex: amd64
111 pub fn archrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]arch().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
112
113 /// The Index Type of the PackageFile. Known values are:
114 ///
115 /// Debian Package Index, Debian Translation Index, Debian dpkg status
116 /// file,
117 pub fn index_typerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]index_type().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
118
119 /// `true` if the PackageFile contains packages that can be downloaded
120 pub fn is_downloadablerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]is_downloadable().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> bool;
121
122 /// The Index number of the PackageFile
•123 pub fn indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]index().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> usize;
124 /// Clone the pointer.
125 ///
126 /// # Safety
127 ///
128 /// If the inner pointer is null segfaults can occur.
129 ///
130 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
131 /// is recommended.
132 ///
133 /// The returned UniquePtr cannot outlive the cache.
134 unsafe fn uniquerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]unique().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#>;
135 pub fn raw_nextrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]raw_next().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#>);
136 pub fn endrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[PkgFileIterator]end().(self: &PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#) -> bool;
137
138 /// Return the package file associated with this version file.
139 ///
140 /// # Safety
141 ///
142 /// If the inner pointer is null segfaults can occur.
143 ///
144 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
145 /// is recommended.
146 ///
147 /// The returned UniquePtr cannot outlive the cache.
148 unsafe fn package_filerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]package_file().(self: &VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#>;
149
•150 pub fn indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]index().(self: &VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#) -> usize;
151 /// Clone the pointer.
152 ///
153 /// # Safety
154 ///
155 /// If the inner pointer is null segfaults can occur.
156 ///
157 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
158 /// is recommended.
159 ///
160 /// The returned UniquePtr cannot outlive the cache.
161 unsafe fn uniquerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]unique().(self: &VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#>;
162 pub fn raw_nextrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]raw_next().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#>);
163 pub fn endrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[VerFileIterator]end().(self: &VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#) -> bool;
164
•165 pub fn indexrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[DescIterator]index().(self: &DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#) -> usize;
166 /// Clone the pointer.
167 ///
168 /// # Safety
169 ///
170 /// If the inner pointer is null segfaults can occur.
171 ///
172 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
173 /// is recommended.
174 ///
175 /// The returned UniquePtr cannot outlive the cache.
176 unsafe fn uniquerust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[DescIterator]unique().(self: &DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#>;
177 pub fn raw_nextrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[DescIterator]raw_next().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#>);
178 pub fn endrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/impl#[DescIterator]end().(self: &DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#) -> bool;
179 }
180 }