⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

DependencyResolver

Struct DependencyResolver 

Source
pub struct DependencyResolver { /* private fields */ }
Expand description

Dependency resolver with DPLL-based SAT solving.

Supports:

  • Greedy resolution (fast path for simple dependency trees)
  • SAT-based resolution for complex conflict scenarios
  • Virtual packages via provides
  • Upgrade computation

Implementations§

Source§

impl DependencyResolver

Source

pub fn new() -> Self

Source

pub fn register_package( &mut self, package_id: PackageId, version: Version, dependencies: Vec<Dependency>, conflicts: Vec<PackageId>, )

Register a package version

Source

pub fn register_package_full( &mut self, package_id: PackageId, version: Version, dependencies: Vec<Dependency>, conflicts: Vec<PackageId>, provides: Vec<PackageId>, )

Register a package version with virtual provides

Source

pub fn resolve( &self, dependencies: &[Dependency], ) -> Result<Vec<(PackageId, Version)>, ResolverError>

Resolve dependencies for a package using greedy algorithm.

Returns a topologically sorted list of packages to install. Falls back to SAT solving on conflict.

Source

pub fn resolve_upgrade( &self, installed: &BTreeMap<PackageId, Version>, upgrade_targets: &[PackageId], ) -> Result<Vec<(PackageId, Version)>, ResolverError>

Resolve an upgrade: given currently installed packages and a set of packages to upgrade, compute the minimal set of packages to install.

installed maps package names to their currently installed versions. upgrade_targets lists packages to upgrade (empty means upgrade all).

Returns the list of (package, new_version) pairs that should be installed to satisfy the upgrade.

Source

pub fn latest_version(&self, package_id: &str) -> Option<Version>

Get the latest available version for a package.

Source

pub fn search(&self, query: &str) -> Vec<(PackageId, Version)>

Search available packages by name substring.

Returns matching (package_id, latest_version) pairs.

Source

pub fn get_package_metadata(&self, package_id: &str) -> Option<PackageMetadata>

Get metadata for a package (returns the latest version’s metadata).

Trait Implementations§

Source§

impl Default for DependencyResolver

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for DependencyResolver

§

impl RefUnwindSafe for DependencyResolver

§

impl Send for DependencyResolver

§

impl Sync for DependencyResolver

§

impl Unpin for DependencyResolver

§

impl UnwindSafe for DependencyResolver

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.