pub struct RpPackage { /* private fields */ }
Implementations§
Source§impl RpPackage
impl RpPackage
pub fn new(parts: Vec<String>) -> RpPackage
Sourcepub fn parse(input: &str) -> RpPackage
pub fn parse(input: &str) -> RpPackage
Parse a package from a string.
Warning: This does not perform any validation that the given package only contains identifier components!
- An empty string results in a package without any parts.
- All other strings are split on dots.
Sourcepub fn join_package(self, other: RpPackage) -> RpPackage
pub fn join_package(self, other: RpPackage) -> RpPackage
Join with the other package.
Sourcepub fn join_versioned(&self, other: RpVersionedPackage) -> RpVersionedPackage
pub fn join_versioned(&self, other: RpVersionedPackage) -> RpVersionedPackage
Join this package with another, versioned, package.
Sourcepub fn join(&self, separator: &str) -> String
pub fn join(&self, separator: &str) -> String
Join the parts of this package with the given string.
Sourcepub fn starts_with(&self, other: &RpPackage) -> bool
pub fn starts_with(&self, other: &RpPackage) -> bool
Check if this package starts with another package.
Sourcepub fn with_replacements(self, keywords: &HashMap<String, String>) -> Self
pub fn with_replacements(self, keywords: &HashMap<String, String>) -> Self
Replace all keyword components in this package.
Sourcepub fn with_naming<N>(self, naming: N) -> Self
pub fn with_naming<N>(self, naming: N) -> Self
Apply the given naming policy to each part.
Trait Implementations§
Source§impl AsPackage for RpPackage
impl AsPackage for RpPackage
Source§fn try_as_package<'a>(&'a self) -> Result<Cow<'a, RpPackage>>
fn try_as_package<'a>(&'a self) -> Result<Cow<'a, RpPackage>>
Attempt to treat the current object as a package.
Source§fn prefix_with(self, prefix: RpPackage) -> Self
fn prefix_with(self, prefix: RpPackage) -> Self
Attempt to prefix the package.
Source§impl<'de> Deserialize<'de> for RpPackage
impl<'de> Deserialize<'de> for RpPackage
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for RpPackage
impl Ord for RpPackage
Source§impl PartialOrd for RpPackage
impl PartialOrd for RpPackage
impl Eq for RpPackage
impl StructuralPartialEq for RpPackage
Auto Trait Implementations§
impl Freeze for RpPackage
impl RefUnwindSafe for RpPackage
impl Send for RpPackage
impl Sync for RpPackage
impl Unpin for RpPackage
impl UnwindSafe for RpPackage
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