Struct rpm::Dependency

source ·
pub struct Dependency {
    pub name: String,
    pub flags: DependencyFlags,
    pub version: String,
}
Expand description

Description of a dependency as present in a RPM header record.

Fields§

§name: String§flags: DependencyFlags§version: String

Implementations§

source§

impl Dependency

source

pub fn any(dep_name: impl Into<String>) -> Self

Create a dependency on any version of some package or file (or string in general).

source

pub fn eq(dep_name: impl Into<String>, version: impl Into<String>) -> Self

Create a dependency on an exact version of some package.

source

pub fn less(dep_name: impl Into<String>, version: impl Into<String>) -> Self

Create a dependency on a version of some package less than the provided one.

source

pub fn less_eq(dep_name: impl Into<String>, version: impl Into<String>) -> Self

Create a dependency on a version of some package less than or equal to the provided one.

source

pub fn greater(dep_name: impl Into<String>, version: impl Into<String>) -> Self

Create a dependency on a version of some package greater than the provided one.

source

pub fn greater_eq( dep_name: impl Into<String>, version: impl Into<String>, ) -> Self

Create a dependency on a version of some package greater than or equal to the provided one.

source

pub fn rpmlib(dep_name: impl Into<String>, version: impl Into<String>) -> Self

Create a dependency on an rpm feature, required to install this package

source

pub fn config(dep_name: &str, version: impl Into<String>) -> Self

Add a config dependency

source

pub fn user(username: &str) -> Self

Create a new user dependency

If such a dependency is required, versions of RPM 4.19 and newer will automatically create the required users and groups using systemd sys.users.d.

source

pub fn group(groupname: &str) -> Self

Create a new group dependency

If such a dependency is required, versions of RPM 4.19 and newer will automatically create the required users and groups using systemd sys.users.d.

source

pub fn script_pre(dep_name: impl Into<String>) -> Self

Create a dependency on a package or file required for a pre-install script.

source

pub fn script_post(dep_name: impl Into<String>) -> Self

Create a dependency on a package or file required for a post-install script.

source

pub fn script_preun(dep_name: impl Into<String>) -> Self

Create a dependency on a package or file required for a pre-un-install script.

source

pub fn script_postun(dep_name: impl Into<String>) -> Self

Create a dependency on a package or file required for a post-un-install script.

Trait Implementations§

source§

impl Debug for Dependency

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Dependency

source§

fn eq(&self, other: &Dependency) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Dependency

source§

impl StructuralPartialEq for Dependency

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V