| 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 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#; |
| 3 |
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/; |
| 4 |
|
| 5 |
use cxxrust-analyzer cargo cxx 1.0.199 crate/::UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#; |
| 6 |
|
| 7 |
use craterust-analyzer cargo rust-apt 0.8.0 crate/::rawrust-analyzer cargo rust-apt 0.8.0 raw/::{IntoRawIterrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#, PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#}; |
| 8 |
use craterust-analyzer cargo rust-apt 0.8.0 crate/::{create_depends_maprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/create_depends_map()., Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, DepTyperust-analyzer cargo rust-apt 0.8.0 iterators/dependency/DepType#, Dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/Dependency#, Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#, Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#}; |
| 9 |
/// The state that the user wishes the package to be in. |
| 10 |
#[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:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 11 |
pub enum PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState# { |
| 12 |
Unknownrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Unknown# = 0, |
| 13 |
Installrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Install# = 1, |
| 14 |
Holdrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Hold# = 2, |
| 15 |
DeInstallrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#DeInstall# = 3, |
| 16 |
Purgerust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Purge# = 4, |
| 17 |
} |
| 18 |
|
| 19 |
impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<u8> for PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState# { |
| 20 |
fn fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgSelectedState][`From<u8>`]from().(value: u8) -> Selfrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgSelectedState][`From<u8>`] { |
| 21 |
match value { |
| 22 |
0 => PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::Unknownrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Unknown#, |
| 23 |
1 => PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::Installrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Install#, |
| 24 |
2 => PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::Holdrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Hold#, |
| 25 |
3 => PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::DeInstallrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#DeInstall#, |
| 26 |
4 => PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::Purgerust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#Purge#, |
| 27 |
_ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("PkgSelectedState is malformed?"), |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
/// Installation state of the package |
| 33 |
#[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:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 34 |
pub enum PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState# { |
| 35 |
Okrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#Ok# = 0, |
| 36 |
ReInstReqrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#ReInstReq# = 1, |
| 37 |
HoldInstrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#HoldInst# = 2, |
| 38 |
HoldReInstReqrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#HoldReInstReq# = 3, |
| 39 |
} |
| 40 |
|
| 41 |
impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<u8> for PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState# { |
| 42 |
fn fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgInstState][`From<u8>`]from().(value: u8) -> Selfrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgInstState][`From<u8>`] { |
| 43 |
match value { |
| 44 |
0 => PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#::Okrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#Ok#, |
| 45 |
1 => PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#::ReInstReqrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#ReInstReq#, |
| 46 |
2 => PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#::HoldInstrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#HoldInst#, |
| 47 |
3 => PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#::HoldReInstReqrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#HoldReInstReq#, |
| 48 |
_ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("PkgInstState is malformed?"), |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
/// The current state of a Package. |
| 54 |
#[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:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 55 |
pub enum PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState# { |
| 56 |
NotInstalledrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#NotInstalled# = 0, |
| 57 |
UnPackedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#UnPacked# = 1, |
| 58 |
HalfConfiguredrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#HalfConfigured# = 2, |
| 59 |
HalfInstalledrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#HalfInstalled# = 4, |
| 60 |
ConfigFilesrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#ConfigFiles# = 5, |
| 61 |
Installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#Installed# = 6, |
| 62 |
TriggersAwaitedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#TriggersAwaited# = 7, |
| 63 |
TriggersPendingrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#TriggersPending# = 8, |
| 64 |
} |
| 65 |
|
| 66 |
impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<u8> for PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState# { |
| 67 |
fn fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgCurrentState][`From<u8>`]from().(value: u8) -> Selfrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgCurrentState][`From<u8>`] { |
| 68 |
match value { |
| 69 |
0 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::NotInstalledrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#NotInstalled#, |
| 70 |
1 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::UnPackedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#UnPacked#, |
| 71 |
2 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::HalfConfiguredrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#HalfConfigured#, |
| 72 |
4 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::HalfInstalledrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#HalfInstalled#, |
| 73 |
5 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::ConfigFilesrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#ConfigFiles#, |
| 74 |
6 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::Installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#Installed#, |
| 75 |
7 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::TriggersAwaitedrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#TriggersAwaited#, |
| 76 |
8 => PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::TriggersPendingrust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#TriggersPending#, |
| 77 |
_ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("PkgCurrentState is malformed?"), |
| 78 |
} |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
/// A single unique libapt package. |
| 83 |
pub struct Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { |
| 84 |
pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr.: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#>, |
| 85 |
pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache.: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, |
| 86 |
rdepends_maprust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#rdepends_map.: OnceCellrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/OnceCell#<HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<DepTyperust-analyzer cargo rust-apt 0.8.0 iterators/dependency/DepType#, Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/Dependency#<'a>>>>, |
| 87 |
} |
| 88 |
|
| 89 |
impl<'a> Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { |
| 90 |
pub fn newrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]new().(cache: &'a Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, ptr: UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#>) -> Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { |
| 91 |
Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package# { |
| 92 |
ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr., |
| 93 |
cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache., |
| 94 |
rdepends_maprust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#rdepends_map.: 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().(), |
| 95 |
} |
| 96 |
} |
| 97 |
|
| 98 |
/// Returns a Reverse Dependency Map of the package |
| 99 |
/// |
| 100 |
/// Dependencies are in a `Vec<Dependency>` |
| 101 |
/// |
| 102 |
/// The Dependency struct represents an Or Group of dependencies. |
| 103 |
/// |
| 104 |
/// For example where we use the [`crate::DepType::Depends`] key: |
| 105 |
/// |
| 106 |
/// ``` |
| 107 |
/// use rust_apt::{new_cache, DepType}; |
| 108 |
/// let cache = new_cache!().unwrap(); |
| 109 |
/// let pkg = cache.get("apt").unwrap(); |
| 110 |
/// for dep in pkg.rdepends().get(&DepType::Depends).unwrap() { |
| 111 |
/// if dep.is_or() { |
| 112 |
/// for base_dep in dep.iter() { |
| 113 |
/// println!("{}", base_dep.name()) |
| 114 |
/// } |
| 115 |
/// } else { |
| 116 |
/// // is_or is false so there is only one BaseDep |
| 117 |
/// println!("{}", dep.first().name()) |
| 118 |
/// } |
| 119 |
/// } |
| 120 |
/// ``` |
| 121 |
pub fn rdependsrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]rdepends().(&self) -> &HashMaprust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/map/HashMap#<DepTyperust-analyzer cargo rust-apt 0.8.0 iterators/dependency/DepType#, Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/Dependency#<'a>>> { |
| 122 |
self.rdepends_maprust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#rdepends_map..get_or_initrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cell/once/impl#[`OnceCell<T>`]get_or_init().(|| { |
| 123 |
create_depends_maprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/create_depends_map().(self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache., unsafe { self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..rdependsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]rdepends().().make_saferust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<DepIterator>`][IntoRawIter]make_safe().() }) |
| 124 |
}) |
| 125 |
} |
| 126 |
|
| 127 |
/// Return either a Version or None |
| 128 |
/// |
| 129 |
/// # Example: |
| 130 |
/// ``` |
| 131 |
/// use rust_apt::new_cache; |
| 132 |
/// |
| 133 |
/// let cache = new_cache!().unwrap(); |
| 134 |
/// let pkg = cache.get("apt").unwrap(); |
| 135 |
/// |
| 136 |
/// pkg.get_version("2.4.7"); |
| 137 |
/// ``` |
| 138 |
pub fn get_versionrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]get_version().(&'a self, version_str: &str) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>> { |
| 139 |
for ver in unsafe { self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]versions().().raw_iterrust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<VerIterator>`][IntoRawIter]raw_iter().() } { |
| 140 |
if version_str rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().==rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]eq().ver.versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/impl#[VerIterator]version().() { |
| 141 |
return Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(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().(ver, self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache.)); |
| 142 |
} |
| 143 |
} |
| 144 |
Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# |
| 145 |
} |
| 146 |
|
| 147 |
/// True if the Package is installed. |
| 148 |
pub fn is_installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_installed().(&self) -> bool { unsafe { !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.current_versionrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]current_version().().endrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/impl#[VerIterator]end().() } } |
| 149 |
|
| 150 |
/// True if the package has versions. |
| 151 |
/// |
| 152 |
/// If a package has no versions it is considered virtual. |
| 153 |
pub fn has_versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]has_versions().(&self) -> bool { unsafe { !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]versions().().endrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/impl#[VerIterator]end().() } } |
| 154 |
|
| 155 |
/// True if the package provides any other packages. |
| 156 |
pub fn has_providesrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]has_provides().(&self) -> bool { unsafe { !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..providesrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]provides().().endrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/impl#[PrvIterator]end().() } } |
| 157 |
|
| 158 |
/// The installed state of this package. |
| 159 |
pub fn inst_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]inst_state().(&self) -> PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState# { PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#::fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgInstState][`From<u8>`]from().(self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..inst_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]inst_state().()) } |
| 160 |
|
| 161 |
/// The selected state of this package. |
| 162 |
pub fn selected_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]selected_state().(&self) -> PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState# { |
| 163 |
PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#::fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgSelectedState][`From<u8>`]from().(self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..selected_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]selected_state().()) |
| 164 |
} |
| 165 |
|
| 166 |
/// The current state of this package. |
| 167 |
pub fn current_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]current_state().(&self) -> PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState# { |
| 168 |
PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#::fromrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[PkgCurrentState][`From<u8>`]from().(self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..current_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]current_state().()) |
| 169 |
} |
| 170 |
|
| 171 |
/// Returns the version object of the installed version. |
| 172 |
/// |
| 173 |
/// If there isn't an installed version, returns None |
| 174 |
pub fn installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]installed().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>> { |
| 175 |
Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(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().( |
| 176 |
unsafe { self.current_versionrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]current_version().().make_saferust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<VerIterator>`][IntoRawIter]make_safe().() }?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch()., |
| 177 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache., |
| 178 |
)) |
| 179 |
} |
| 180 |
|
| 181 |
/// Returns the version object of the candidate. |
| 182 |
/// |
| 183 |
/// If there isn't a candidate, returns None |
| 184 |
pub fn candidaterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]candidate().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>> { |
| 185 |
Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(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().( |
| 186 |
unsafe { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().candidate_versionrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]candidate_version().(self).make_saferust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<VerIterator>`][IntoRawIter]make_safe().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch(). }, |
| 187 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache., |
| 188 |
)) |
| 189 |
} |
| 190 |
|
| 191 |
/// Returns the install version if it exists. |
| 192 |
/// |
| 193 |
/// # This differs from [`crate::Package::installed`] in the |
| 194 |
/// # following ways: |
| 195 |
/// |
| 196 |
/// * If a version is marked for install this will return the version to be |
| 197 |
/// installed. |
| 198 |
/// * If an installed package is marked for removal, this will return |
| 199 |
/// [`None`]. |
| 200 |
pub fn install_versionrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]install_version().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>> { |
| 201 |
// Cxx error here just indicates that the Version doesn't exist |
| 202 |
Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(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().( |
| 203 |
unsafe { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().install_versionrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]install_version().(self).make_saferust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<VerIterator>`][IntoRawIter]make_safe().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`][Try]branch(). }, |
| 204 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache., |
| 205 |
)) |
| 206 |
} |
| 207 |
|
| 208 |
/// Returns a version list |
| 209 |
/// starting with the newest and ending with the oldest. |
| 210 |
pub fn versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]versions().(&self) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>> { |
| 211 |
unsafe { self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]versions().() } |
| 212 |
.raw_iterrust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<VerIterator>`][IntoRawIter]raw_iter().() |
| 213 |
.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|ver| 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().(ver, self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache.)) |
| 214 |
} |
| 215 |
|
| 216 |
/// Returns a list of providers |
| 217 |
pub fn providesrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]provides().(&self) -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a>> { |
| 218 |
unsafe { self.ptrrust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#ptr..providesrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]provides().() } |
| 219 |
.raw_iterrust-analyzer cargo rust-apt 0.8.0 raw/impl#[`UniquePtr<PrvIterator>`][IntoRawIter]raw_iter().() |
| 220 |
.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|p| Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#::newrust-analyzer cargo rust-apt 0.8.0 iterators/provider/impl#[`Provider<'a>`]new().(p, self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache.)) |
| 221 |
} |
| 222 |
|
| 223 |
/// Check if the package is upgradable. |
| 224 |
/// |
| 225 |
/// ## skip_depcache: |
| 226 |
/// |
| 227 |
/// Skipping the DepCache is unnecessary if it's already been initialized. |
| 228 |
/// If you're unsure use `false` |
| 229 |
/// |
| 230 |
/// * [true] = Increases performance by skipping the pkgDepCache. |
| 231 |
/// * [false] = Use DepCache to check if the package is upgradable |
| 232 |
pub fn is_upgradablerust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_upgradable().(&self) -> bool { |
| 233 |
self.is_installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_installed().() && self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().is_upgradablerust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]is_upgradable().(self) |
| 234 |
} |
| 235 |
|
| 236 |
/// Check if the package is auto installed. (Not installed by the user) |
| 237 |
pub fn is_auto_installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_auto_installed().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().is_auto_installedrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]is_auto_installed().(self) } |
| 238 |
|
| 239 |
/// Check if the package is auto removable |
| 240 |
pub fn is_auto_removablerust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_auto_removable().(&self) -> bool { |
| 241 |
(self.is_installedrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_installed().() || self.marked_installrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_install().()) && self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().is_garbagerust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]is_garbage().(self) |
| 242 |
} |
| 243 |
|
| 244 |
/// Check if the package is now broken |
| 245 |
pub fn is_now_brokenrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_now_broken().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().is_now_brokenrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]is_now_broken().(self) } |
| 246 |
|
| 247 |
/// Check if the package package installed is broken |
| 248 |
pub fn is_inst_brokenrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]is_inst_broken().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().is_inst_brokenrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]is_inst_broken().(self) } |
| 249 |
|
| 250 |
/// Check if the package is marked install |
| 251 |
pub fn marked_installrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_install().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_installrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_install().(self) } |
| 252 |
|
| 253 |
/// Check if the package is marked upgrade |
| 254 |
pub fn marked_upgraderust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_upgrade().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_upgraderust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_upgrade().(self) } |
| 255 |
|
| 256 |
/// Check if the package is marked purge |
| 257 |
pub fn marked_purgerust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_purge().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_purgerust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_purge().(self) } |
| 258 |
|
| 259 |
/// Check if the package is marked delete |
| 260 |
pub fn marked_deleterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_delete().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_deleterust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_delete().(self) } |
| 261 |
|
| 262 |
/// Check if the package is marked keep |
| 263 |
pub fn marked_keeprust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_keep().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_keeprust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_keep().(self) } |
| 264 |
|
| 265 |
/// Check if the package is marked downgrade |
| 266 |
pub fn marked_downgraderust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_downgrade().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_downgraderust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_downgrade().(self) } |
| 267 |
|
| 268 |
/// Check if the package is marked reinstall |
| 269 |
pub fn marked_reinstallrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]marked_reinstall().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().marked_reinstallrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]marked_reinstall().(self) } |
| 270 |
|
| 271 |
/// # Mark a package as automatically installed. |
| 272 |
/// |
| 273 |
/// ## mark_auto: |
| 274 |
/// * [true] = Mark the package as automatically installed. |
| 275 |
/// * [false] = Mark the package as manually installed. |
| 276 |
pub fn mark_autorust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]mark_auto().(&self, mark_auto: bool) -> bool { |
| 277 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().mark_autorust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]mark_auto().(self, mark_auto); |
| 278 |
// Convert to a bool to remain consistent with other mark functions. |
| 279 |
true |
| 280 |
} |
| 281 |
|
| 282 |
/// # Mark a package for keep. |
| 283 |
/// |
| 284 |
/// ## Returns: |
| 285 |
/// * [true] if the mark was successful |
| 286 |
/// * [false] if the mark was unsuccessful |
| 287 |
/// |
| 288 |
/// This means that the package will not be changed from its current |
| 289 |
/// version. This will not stop a reinstall, but will stop removal, upgrades |
| 290 |
/// and downgrades |
| 291 |
/// |
| 292 |
/// We don't believe that there is any reason to unmark packages for keep. |
| 293 |
/// If someone has a reason, and would like it implemented, please put in a |
| 294 |
/// feature request. |
| 295 |
pub fn mark_keeprust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]mark_keep().(&self) -> bool { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().mark_keeprust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]mark_keep().(self) } |
| 296 |
|
| 297 |
/// # Mark a package for removal. |
| 298 |
/// |
| 299 |
/// ## Returns: |
| 300 |
/// * [true] if the mark was successful |
| 301 |
/// * [false] if the mark was unsuccessful |
| 302 |
/// |
| 303 |
/// ## purge: |
| 304 |
/// * [true] = Configuration files will be removed along with the package. |
| 305 |
/// * [false] = Only the package will be removed. |
| 306 |
pub fn mark_deleterust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]mark_delete().(&self, purge: bool) -> bool { |
| 307 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().mark_deleterust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]mark_delete().(self, purge) |
| 308 |
} |
| 309 |
|
| 310 |
/// # Mark a package for installation. |
| 311 |
/// |
| 312 |
/// ## auto_inst: |
| 313 |
/// * [true] = Additionally mark the dependencies for this package. |
| 314 |
/// * [false] = Mark only this package. |
| 315 |
/// |
| 316 |
/// ## from_user: |
| 317 |
/// * [true] = The package will be marked manually installed. |
| 318 |
/// * [false] = The package will be unmarked automatically installed. |
| 319 |
/// |
| 320 |
/// ## Returns: |
| 321 |
/// * [true] if the mark was successful |
| 322 |
/// * [false] if the mark was unsuccessful |
| 323 |
/// |
| 324 |
/// If a package is already installed, at the latest version, |
| 325 |
/// and you mark that package for install you will get true, |
| 326 |
/// but the package will not be altered. |
| 327 |
/// `pkg.marked_install()` will be false |
| 328 |
pub fn mark_installrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]mark_install().(&self, auto_inst: bool, from_user: bool) -> bool { |
| 329 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache. |
| 330 |
.depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().() |
| 331 |
.mark_installrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]mark_install().(self, auto_inst, from_user) |
| 332 |
} |
| 333 |
|
| 334 |
/// # Mark a package for reinstallation. |
| 335 |
/// |
| 336 |
/// ## Returns: |
| 337 |
/// * [true] if the mark was successful |
| 338 |
/// * [false] if the mark was unsuccessful |
| 339 |
/// |
| 340 |
/// ## reinstall: |
| 341 |
/// * [true] = The package will be marked for reinstall. |
| 342 |
/// * [false] = The package will be unmarked for reinstall. |
| 343 |
pub fn mark_reinstallrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]mark_reinstall().(&self, reinstall: bool) -> bool { |
| 344 |
self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..depcacherust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]depcache().().mark_reinstallrust-analyzer cargo rust-apt 0.8.0 depcache/raw/impl#[PkgDepCache]mark_reinstall().(self, reinstall); |
| 345 |
// Convert to a bool to remain consistent with other mark functions/ |
| 346 |
true |
| 347 |
} |
| 348 |
|
| 349 |
/// Protect a package's state |
| 350 |
/// for when [`crate::cache::Cache::resolve`] is called. |
| 351 |
pub fn protectrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]protect().(&self) { self.cacherust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#cache..resolverrust-analyzer cargo rust-apt 0.8.0 cache/impl#[Cache]resolver().().protectrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/impl#[ProblemResolver]protect().(self) } |
| 352 |
} |
| 353 |
|
| 354 |
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 Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { |
| 355 |
fn fmtrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'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# { |
| 356 |
writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "{}", self.namerust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]name().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 357 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 358 |
} |
| 359 |
} |
| 360 |
|
| 361 |
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 Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> { |
| 362 |
fn fmtrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'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# { |
| 363 |
let versions: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#> = self.versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/impl#[`Package<'a>`]versions().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().(); |
| 364 |
f.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().("Package") |
| 365 |
.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/package/raw/impl#[PkgIterator]name().()) |
| 366 |
.fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("arch", &self.archrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]arch().()) |
| 367 |
.fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("virtual", &versions.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().()) |
| 368 |
.fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("versions", &versions) |
| 369 |
.finish_non_exhaustiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish_non_exhaustive().() |
| 370 |
} |
| 371 |
} |
| 372 |
|
| 373 |
#[cxxrust-analyzer cargo cxx 1.0.199 crate/::bridgerust-analyzer cargo cxxbridge-macro 1.0.199 bridge:] |
| 374 |
pub(craterust-analyzer cargo rust-apt 0.8.0 crate/) mod rawrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/ { |
| 375 |
unsafe extern "C++" { |
| 376 |
includerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include!!("rust-apt/apt-pkg-c/package.h"); |
| 377 |
|
| 378 |
type PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#; |
| 379 |
type VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/VerIterator# = craterust-analyzer cargo rust-apt 0.8.0 crate/::iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/VerIterator#; |
| 380 |
type PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PrvIterator# = craterust-analyzer cargo rust-apt 0.8.0 crate/::iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#; |
| 381 |
type DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/DepIterator# = craterust-analyzer cargo rust-apt 0.8.0 crate/::iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/raw/DepIterator#; |
| 382 |
|
| 383 |
/// Get the name of the package without the architecture. |
| 384 |
pub fn namerust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]name().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> &str; |
| 385 |
|
| 386 |
/// Get the architecture of a package. |
| 387 |
pub fn archrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]arch().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> &str; |
| 388 |
|
| 389 |
/// Get the fullname of the package. |
| 390 |
/// |
| 391 |
/// Pretty is a bool that will omit the native arch. |
| 392 |
pub fn fullnamerust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]fullname().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#, pretty: bool) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#; |
| 393 |
|
| 394 |
/// Get the current state of a package. |
| 395 |
pub fn current_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]current_state().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> u8; |
| 396 |
|
| 397 |
/// Get the installed state of a package. |
| 398 |
pub fn inst_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]inst_state().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> u8; |
| 399 |
|
| 400 |
/// Get the selected state of a package. |
| 401 |
pub fn selected_staterust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]selected_state().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> u8; |
| 402 |
|
| 403 |
/// True if the package is essential. |
| 404 |
pub fn is_essentialrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]is_essential().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> bool; |
| 405 |
|
| 406 |
/// Get a pointer the the currently installed version. |
| 407 |
/// |
| 408 |
/// # Safety |
| 409 |
/// |
| 410 |
/// If the inner pointer is null segfaults can occur. |
| 411 |
/// |
| 412 |
/// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option |
| 413 |
/// is recommended. |
| 414 |
/// |
| 415 |
/// The returned UniquePtr cannot outlive the cache. |
| 416 |
unsafe fn current_versionrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]current_version().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/VerIterator#>; |
| 417 |
|
| 418 |
/// Get a pointer to the beginning of the VerIterator. |
| 419 |
/// |
| 420 |
/// # Safety |
| 421 |
/// |
| 422 |
/// If the inner pointer is null segfaults can occur. |
| 423 |
/// |
| 424 |
/// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option |
| 425 |
/// is recommended. |
| 426 |
/// |
| 427 |
/// The returned UniquePtr cannot outlive the cache. |
| 428 |
unsafe fn versionsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]versions().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/VerIterator#>; |
| 429 |
|
| 430 |
/// Get the providers of this package. |
| 431 |
/// |
| 432 |
/// # Safety |
| 433 |
/// |
| 434 |
/// If the inner pointer is null segfaults can occur. |
| 435 |
/// |
| 436 |
/// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option |
| 437 |
/// is recommended. |
| 438 |
/// |
| 439 |
/// The returned UniquePtr cannot outlive the cache. |
| 440 |
unsafe fn providesrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]provides().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PrvIterator#>; |
| 441 |
|
| 442 |
/// Get the reverse dependencies of this package |
| 443 |
/// |
| 444 |
/// # Safety |
| 445 |
/// |
| 446 |
/// If the inner pointer is null segfaults can occur. |
| 447 |
/// |
| 448 |
/// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option |
| 449 |
/// is recommended. |
| 450 |
/// |
| 451 |
/// The returned UniquePtr cannot outlive the cache. |
| 452 |
unsafe fn rdependsrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]rdepends().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/DepIterator#>; |
| 453 |
|
| •454 |
pub fn indexrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]index().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> usize; |
| 455 |
/// Clone the pointer. |
| 456 |
/// |
| 457 |
/// # Safety |
| 458 |
/// |
| 459 |
/// If the inner pointer is null segfaults can occur. |
| 460 |
/// |
| 461 |
/// Using [`crate::raw::IntoRawIter::make_safe`] to convert to an Option |
| 462 |
/// is recommended. |
| 463 |
/// |
| 464 |
/// The returned UniquePtr cannot outlive the cache. |
| 465 |
unsafe fn uniquerust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]unique().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#<PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#>; |
| 466 |
pub fn raw_nextrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]raw_next().(self: Pinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core pin/Pin#<&mut PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#>); |
| 467 |
pub fn endrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/impl#[PkgIterator]end().(self: &PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#) -> bool; |
| 468 |
} |
| 469 |
} |