| 1 | //! rust-apt provides bindings to `libapt-pkg`. |
| 2 | //! The goal is to eventually have all of the functionality of `python-apt` |
| 3 | //! |
| 4 | //! The source repository is <https://gitlab.com/volian/rust-apt> |
| 5 | //! For more information please see the readme in the source code. |
| 6 | //! |
| 7 | //! Each module has a `raw` submodule containing c++ bindings to `libapt-pkg` |
| 8 | //! |
| 9 | //! These are safe to use in terms of memory, |
| 10 | //! but may cause segfaults if you do something wrong. |
| 11 | //! |
| 12 | //! If you find a way to segfault without using the `libapt-pkg` bindings |
| 13 | //! directly, please report this as a bug. |
| 14 | |
| 15 | // Clippy is really mad at my safety docs and idk why |
| 16 | #![allow(clippy::missing_safety_doc)] |
| 17 | |
| 18 | #[macro_use] |
| 19 | mod macrosrust-analyzer cargo rust-apt 0.8.0 macros/; |
| 20 | mod acquirerust-analyzer cargo rust-apt 0.8.0 acquire/; |
| 21 | pub mod cacherust-analyzer cargo rust-apt 0.8.0 cache/; |
| 22 | pub mod configrust-analyzer cargo rust-apt 0.8.0 config/; |
| 23 | mod depcacherust-analyzer cargo rust-apt 0.8.0 depcache/; |
| 24 | pub mod errorrust-analyzer cargo rust-apt 0.8.0 error/; |
| 25 | mod iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/; |
| 26 | mod pkgmanagerrust-analyzer cargo rust-apt 0.8.0 pkgmanager/; |
| 27 | pub mod progressrust-analyzer cargo rust-apt 0.8.0 progress/; |
| 28 | pub mod recordsrust-analyzer cargo rust-apt 0.8.0 records/; |
| 29 | pub mod tagfilerust-analyzer cargo rust-apt 0.8.0 tagfile/; |
| 30 | pub mod utilrust-analyzer cargo rust-apt 0.8.0 util/; |
| 31 | |
| 32 | #[doc(inline)] |
| 33 | pub use cacherust-analyzer cargo rust-apt 0.8.0 cache/::{Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache#, PackageSortrust-analyzer cargo rust-apt 0.8.0 cache/PackageSort#}; |
| 34 | pub use iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/::{create_depends_maprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/create_depends_map()., BaseDeprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/BaseDep#, DepFlagsrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/DepFlags/, DepTyperust-analyzer cargo rust-apt 0.8.0 iterators/dependency/DepType#, Dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/Dependency#}; |
| 35 | pub use iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::filesrust-analyzer cargo rust-apt 0.8.0 iterators/files/::{PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#, VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#}; |
| 36 | pub use iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/::{Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#, PkgCurrentStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgCurrentState#, PkgInstStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgInstState#, PkgSelectedStaterust-analyzer cargo rust-apt 0.8.0 iterators/package/PkgSelectedState#}; |
| 37 | pub use iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/::Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#; |
| 38 | pub use iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/::Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#; |
| 39 | |
| 40 | /// C++ bindings for libapt-pkg |
| 41 | pub mod rawrust-analyzer cargo rust-apt 0.8.0 raw/ { |
| 42 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::acquirerust-analyzer cargo rust-apt 0.8.0 acquire/::rawrust-analyzer cargo rust-apt 0.8.0 acquire/raw/::{ |
| 43 | acquire_statusrust-analyzer cargo rust-apt 0.8.0 acquire/raw/acquire_status()., create_acquirerust-analyzer cargo rust-apt 0.8.0 acquire/raw/create_acquire()., AcqTextStatusrust-analyzer cargo rust-apt 0.8.0 acquire/raw/AcqTextStatus#, AcqWorkerrust-analyzer cargo rust-apt 0.8.0 acquire/raw/AcqWorker#, Itemrust-analyzer cargo rust-apt 0.8.0 acquire/raw/Item#, ItemDescrust-analyzer cargo rust-apt 0.8.0 acquire/raw/ItemDesc#, ItemStaterust-analyzer cargo rust-apt 0.8.0 acquire/raw/ItemState#, |
| 44 | PkgAcquirerust-analyzer cargo rust-apt 0.8.0 acquire/raw/PkgAcquire#, |
| 45 | }; |
| 46 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::cacherust-analyzer cargo rust-apt 0.8.0 cache/::rawrust-analyzer cargo rust-apt 0.8.0 cache/raw/::{create_cacherust-analyzer cargo rust-apt 0.8.0 cache/raw/create_cache()., PkgCacheFilerust-analyzer cargo rust-apt 0.8.0 cache/raw/PkgCacheFile#}; |
| 47 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::depcacherust-analyzer cargo rust-apt 0.8.0 depcache/::rawrust-analyzer cargo rust-apt 0.8.0 depcache/raw/::{ActionGrouprust-analyzer cargo rust-apt 0.8.0 depcache/raw/ActionGroup#, PkgDepCacherust-analyzer cargo rust-apt 0.8.0 depcache/raw/PkgDepCache#}; |
| 48 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::iteratorsrust-analyzer cargo rust-apt 0.8.0 iterators/::{ |
| 49 | DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/raw/DepIterator#, DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#, PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#, PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#, PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#, VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#, |
| 50 | VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/VerIterator#, |
| 51 | }; |
| 52 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::pkgmanagerrust-analyzer cargo rust-apt 0.8.0 pkgmanager/::rawrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/::{ |
| 53 | create_pkgmanagerrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/create_pkgmanager()., create_problem_resolverrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/create_problem_resolver()., PackageManagerrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/PackageManager#, ProblemResolverrust-analyzer cargo rust-apt 0.8.0 pkgmanager/raw/ProblemResolver#, |
| 54 | }; |
| 55 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::recordsrust-analyzer cargo rust-apt 0.8.0 records/::rawrust-analyzer cargo rust-apt 0.8.0 records/raw/::{IndexFilerust-analyzer cargo rust-apt 0.8.0 records/raw/IndexFile#, Parserrust-analyzer cargo rust-apt 0.8.0 records/raw/Parser#, PkgRecordsrust-analyzer cargo rust-apt 0.8.0 records/raw/PkgRecords#}; |
| 56 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::utilrust-analyzer cargo rust-apt 0.8.0 util/::rawrust-analyzer cargo rust-apt 0.8.0 util/raw/::*; |
| 57 | // Hmm, maybe this is reason enough to make a wrapper in C++ |
| 58 | // So that the raw functions are methods on a "Config" struct? |
| 59 | // But it may need to not outlive the cache if we do that. |
| 60 | pub mod configrust-analyzer cargo rust-apt 0.8.0 raw/config/ { |
| 61 | pub use craterust-analyzer cargo rust-apt 0.8.0 crate/::configrust-analyzer cargo rust-apt 0.8.0 config/::rawrust-analyzer cargo rust-apt 0.8.0 config/raw/::*; |
| 62 | } |
| 63 | |
| 64 | /// Iterator trait for libapt raw bindings |
| 65 | pub trait IntoRawIterrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter# { |
| 66 | type Itemrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#Item#; |
| 67 | fn raw_iterrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#raw_iter().(self) -> Self::Itemrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#Item#; |
| 68 | |
| 69 | fn make_saferust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#make_safe().(self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Self> |
| 70 | where |
| 71 | Self: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#; |
| 72 | |
| 73 | fn to_vecrust-analyzer cargo rust-apt 0.8.0 raw/IntoRawIter#to_vec().(self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Self> |
| 74 | where |
| 75 | Self: Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#; |
| 76 | } |
| 77 | |
| 78 | use cxxrust-analyzer cargo cxx 1.0.199 crate/::UniquePtrrust-analyzer cargo cxx 1.0.199 unique_ptr/UniquePtr#; |
| 79 | use pasterust-analyzer cargo paste 1.0.15 crate/::pasterust-analyzer cargo paste 1.0.15 paste!; |
| 80 | |
| 81 | raw_iterrust-analyzer cargo rust-apt 0.8.0 macros/raw_iter!!( |
| 82 | PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#, |
| 83 | VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/VerIterator#, |
| 84 | DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/raw/DepIterator#, |
| 85 | PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#, |
| 86 | VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#, |
| 87 | DescIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/DescIterator#, |
| 88 | PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator# |
| 89 | ); |
| 90 | } |
| 91 | |
| 92 | use depcacherust-analyzer cargo rust-apt 0.8.0 depcache/::DepCacherust-analyzer cargo rust-apt 0.8.0 depcache/DepCache#; |
| 93 | use errorrust-analyzer cargo rust-apt 0.8.0 error/::AptErrorsrust-analyzer cargo rust-apt 0.8.0 error/AptErrors#; |
| 94 | use recordsrust-analyzer cargo rust-apt 0.8.0 records/::PackageRecordsrust-analyzer cargo rust-apt 0.8.0 records/PackageRecords#; |
| 95 | |
| 96 | impl_derefrust-analyzer cargo rust-apt 0.8.0 macros/impl_deref!!( |
| 97 | Cacherust-analyzer cargo rust-apt 0.8.0 cache/Cache# -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgCacheFilerust-analyzer cargo rust-apt 0.8.0 cache/raw/PkgCacheFile#, |
| 98 | DepCacherust-analyzer cargo rust-apt 0.8.0 depcache/DepCache# -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgDepCacherust-analyzer cargo rust-apt 0.8.0 depcache/raw/PkgDepCache#, |
| 99 | PackageRecordsrust-analyzer cargo rust-apt 0.8.0 records/PackageRecords# -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgRecordsrust-analyzer cargo rust-apt 0.8.0 records/raw/PkgRecords#, |
| 100 | AptErrorsrust-analyzer cargo rust-apt 0.8.0 error/AptErrors# -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<errorrust-analyzer cargo rust-apt 0.8.0 error/::rawrust-analyzer cargo rust-apt 0.8.0 error/raw/::AptErrorrust-analyzer cargo rust-apt 0.8.0 error/raw/AptError#>, |
| 101 | Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/package/raw/PkgIterator#, |
| 102 | Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::VerIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/version/raw/VerIterator#, |
| 103 | Dependencyrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/Dependency#<'a> -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<BaseDeprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/BaseDep#<'a>>, |
| 104 | BaseDeprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/BaseDep#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::DepIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/dependency/raw/DepIterator#, |
| 105 | Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PrvIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/provider/raw/PrvIterator#, |
| 106 | VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::VerFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/VerFileIterator#, |
| 107 | PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a> -> rawrust-analyzer cargo rust-apt 0.8.0 raw/::PkgFileIteratorrust-analyzer cargo rust-apt 0.8.0 iterators/files/raw/PkgFileIterator#, |
| 108 | ); |
| 109 | |
| 110 | // Version is omitted because it has special needs |
| 111 | impl_partial_eqrust-analyzer cargo rust-apt 0.8.0 macros/impl_partial_eq!!( |
| 112 | Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a>, |
| 113 | BaseDeprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/BaseDep#<'a>, |
| 114 | Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a>, |
| 115 | VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a>, |
| 116 | PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a>, |
| 117 | ); |
| 118 | |
| 119 | impl_hash_eqrust-analyzer cargo rust-apt 0.8.0 macros/impl_hash_eq!!( |
| 120 | Packagerust-analyzer cargo rust-apt 0.8.0 iterators/package/Package#<'a>, |
| 121 | Versionrust-analyzer cargo rust-apt 0.8.0 iterators/version/Version#<'a>, |
| 122 | BaseDeprust-analyzer cargo rust-apt 0.8.0 iterators/dependency/BaseDep#<'a>, |
| 123 | Providerrust-analyzer cargo rust-apt 0.8.0 iterators/provider/Provider#<'a>, |
| 124 | VersionFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/VersionFile#<'a>, |
| 125 | PackageFilerust-analyzer cargo rust-apt 0.8.0 iterators/files/PackageFile#<'a>, |
| 126 | ); |