Debian Codegraph @

src/iterators/provider.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/::fmtrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc fmt/;
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/::PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#;
6 use craterust-analyzer cargo rust-apt 0.8.0 crate/::{Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#, Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#};
7
8 /// A Provider provides a Version and/or Package.
9 ///
10 /// Typically if you had a virtual package you would get its providers
11 /// to find which Package/Version you should really install.
12 pub struct Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> {
13 pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) ptrrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#ptr.: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#>,
14 cacherust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#cache.: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#,
15 }
16
17 impl<'a> Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> {
18 pub fn newrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]new().(ptr: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#>, cache: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#) -> Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> {
19 Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider# { ptrrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#ptr., cacherust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#cache. }
20 }
21
22 /// Return the Target Package of the provider.
23 pub fn packagerust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]package().(&self) -> Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#::newrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]new().(self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#cache., unsafe { self.target_pkgrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]target_pkg().() }) }
24
25 /// Return the Target Version of the provider.
26 pub fn versionrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]version().(&'a self) -> Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a> {
27 Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#::newrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]new().(unsafe { self.target_verrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]target_ver().() }, self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#cache.)
28 }
29 }
30
31 impl<'a> 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 Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> {
32 fn fmtrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`][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# {
33 let version = self.versionrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]version().();
34 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(
35 f,
36 "{} provides {} {}",
37 self.namerust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]name().(),
38 version.parentrust-analyzer cargo rust-apt 0.8.0 iterators/version/impl#[`Version<'a>`]parent().().fullnamerust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]fullname().(false),
39 version.versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/impl#[VerIterator]version().(),
40 )?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
41 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
42 }
43 }
44
45 impl<'a> 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 Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> {
46 fn fmtrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`][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# {
47 f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Provider")
48 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("name", &self.namerust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]name().())
49 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("version", &self.versionrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]version().())
50 .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().()
51 }
52 }
53
54 #[cxxrust-analyzer cargo cxx 1.0.199 crate/::bridgerust-analyzer cargo cxxbridge-macro 1.0.199 bridge:]
55 pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) mod rawrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/ {
56 unsafe extern "C++" {
57 includerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include!!("rust-apt/apt-pkg-c/package.h");
58
59 type PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#;
60
61 type PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PkgIterator# = craterust-analyzer cargo rust-apt 0.8.0 crate/::rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#;
62 type VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/VerIterator# = craterust-analyzer cargo rust-apt 0.8.0 crate/::rawrust-analyzer cargo rust-apt 0.8.0 raw/::VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/VerIterator#;
63
64 /// The name of what this provider provides
65 pub fn namerust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]name().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> &str;
66
67 /// The version string that this provides
68 pub fn version_strrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]version_str().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<&str>;
69
70 /// The Target Package that can satisfy this provides
71 ///
72 /// # Safety
73 ///
74 /// If the inner pointer is null segfaults can occur.
75 ///
76 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
77 /// is recommended.
78 ///
79 /// The returned UniquePtr cannot outlive the cache.
80 unsafe fn target_pkgrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]target_pkg().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PkgIterator#>;
81
82 /// The Target Version that can satisfy this provides
83 ///
84 /// # Safety
85 ///
86 /// If the inner pointer is null segfaults can occur.
87 ///
88 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
89 /// is recommended.
90 ///
91 /// The returned UniquePtr cannot outlive the cache.
92 unsafe fn target_verrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]target_ver().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/VerIterator#>;
93
•94 pub fn indexrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]index().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> usize;
95 /// Clone the pointer.
96 ///
97 /// # Safety
98 ///
99 /// If the inner pointer is null segfaults can occur.
100 ///
101 /// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option
102 /// is recommended.
103 ///
104 /// The returned UniquePtr cannot outlive the cache.
105 unsafe fn uniquerust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]unique().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#>;
106 pub fn raw_nextrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]raw_next().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#>);
107 pub fn endrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]end().(self: &PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#) -> bool;
108 }
109 }