pub struct Depend { /* private fields */ }Expand description
Parse DEPENDS and other package dependency types.
pkgsrc uses a few different ways to express package dependencies. The most
common looks something like this, where a dependency on any version of mutt
is expressed, with mutt most likely to be found at mail/mutt (though not
always).
DEPENDS+= mutt-[0-9]*:../../mail/muttThere are a few different types, expressed in DependType.
A DEPENDS match is essentially of the form “Pattern:PkgPath”
Implementations§
source§impl Depend
impl Depend
sourcepub fn new(s: &str) -> Result<Self, DependError>
pub fn new(s: &str) -> Result<Self, DependError>
Create a new Depend from a str slice. Return a DependError
if it cannot be created successfully.
§Example
use pkgsrc::{Depend, Pattern, PkgPath};
let dep = Depend::new("mktool-[0-9]*:../../pkgtools/mktool").unwrap();
assert_eq!(dep.pattern(), &Pattern::new("mktool-[0-9]*").unwrap());
assert_eq!(dep.pkgpath(), &PkgPath::new("pkgtools/mktool").unwrap());
// Invalid, too many ":".
assert!(Depend::new("pkg>0::../../cat/pkg").is_err());
// Invalid, incorrect Dewey specification.
assert!(Depend::new("pkg>0>2:../../cat/pkg").is_err());Trait Implementations§
impl StructuralPartialEq for Depend
Auto Trait Implementations§
impl Freeze for Depend
impl RefUnwindSafe for Depend
impl Send for Depend
impl Sync for Depend
impl Unpin for Depend
impl UnwindSafe for Depend
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)