mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
* rename frontend to web and update contributing guide * rename this time * fix build * restructure rust code * update documentation * update descriptions * Update CONTRIBUTING.md Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com>
23 lines
552 B
Rust
23 lines
552 B
Rust
use models::Version;
|
|
|
|
use crate::prelude::*;
|
|
use crate::s9pk::manifest::PackageId;
|
|
|
|
pub fn get_packages(db: Peeked) -> Result<Vec<(PackageId, Version)>, Error> {
|
|
Ok(db
|
|
.as_package_data()
|
|
.keys()?
|
|
.into_iter()
|
|
.flat_map(|package_id| {
|
|
let version = db
|
|
.as_package_data()
|
|
.as_idx(&package_id)?
|
|
.as_manifest()
|
|
.as_version()
|
|
.de()
|
|
.ok()?;
|
|
Some((package_id, version))
|
|
})
|
|
.collect())
|
|
}
|