Struct reproto_core::RpPackage
[−]
[src]
pub struct RpPackage { /* fields omitted */ }
Methods
impl RpPackage[src]
pub fn new(parts: Vec<String>) -> RpPackage[src]
pub fn parse(input: &str) -> RpPackage[src]
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.
pub fn empty() -> RpPackage[src]
Build an empty package.
pub fn join_package(self, other: RpPackage) -> RpPackage[src]
Join with the other package.
pub fn join_versioned(&self, other: RpVersionedPackage) -> RpVersionedPackage[src]
Join this package with another, versioned, package.
pub fn join(&self, separator: &str) -> String[src]
Join the parts of this package with the given string.
pub fn join_part<S: AsRef<str>>(self, other: S) -> RpPackage[src]
Join with the given part.
pub fn starts_with(&self, other: &RpPackage) -> bool[src]
Check if this package starts with another package.
pub fn with_replacements(self, keywords: &HashMap<String, String>) -> Self[src]
Replace all keyword components in this package.
pub fn with_naming<N>(self, naming: N) -> Self where
N: Fn(&str) -> String, [src]
N: Fn(&str) -> String,
Apply the given naming policy to each part.
pub fn parts(&self) -> Parts[src]
Iterate over the parts in the package.
Trait Implementations
impl Debug for RpPackage[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Clone for RpPackage[src]
fn clone(&self) -> RpPackage[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq for RpPackage[src]
fn eq(&self, __arg_0: &RpPackage) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &RpPackage) -> bool[src]
This method tests for !=.
impl Eq for RpPackage[src]
impl PartialOrd for RpPackage[src]
fn partial_cmp(&self, __arg_0: &RpPackage) -> Option<Ordering>[src]
This method returns an ordering between self and other values if one exists. Read more
fn lt(&self, __arg_0: &RpPackage) -> bool[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, __arg_0: &RpPackage) -> bool[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, __arg_0: &RpPackage) -> bool[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, __arg_0: &RpPackage) -> bool[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl Ord for RpPackage[src]
fn cmp(&self, __arg_0: &RpPackage) -> Ordering[src]
This method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for RpPackage[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)[src]
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl AsPackage for RpPackage[src]
fn try_as_package(&self) -> Result<&RpPackage>[src]
Attempt to treat the current object as a package.
fn prefix_with(self, prefix: RpPackage) -> Self[src]
Attempt to prefix the package.
impl Display for RpPackage[src]
fn fmt(&self, f: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Serialize for RpPackage[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer, [src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for RpPackage[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more