Type Alias PackageBaseName

Source
pub type PackageBaseName = Name;
Expand description

Name of the base package information that one or more packages are built from.

This is a type alias for Name.

§Examples

use std::str::FromStr;

use alpm_types::{Error, Name};

// create PackageBaseName from &str
let pkgbase = Name::from_str("test-123@.foo_+")?;

// format as String
let pkgbase = Name::from_str("foo")?;
assert_eq!("foo", pkgbase.to_string());

Aliased Type§

struct PackageBaseName(String);

Fields§

§0: String

Implementations

Source§

impl Name

Source

pub fn new(name: &str) -> Result<Self, Error>

Create a new Name

Source

pub fn inner(&self) -> &str

Return a reference to the inner type

Source

pub fn parser(input: &mut &str) -> ModalResult<Self>

Recognizes a Name in a string slice.

Consumes all of its input.

§Errors

Returns an error if input contains an invalid alpm-package-name.

Trait Implementations

Source§

impl AsRef<str> for Name

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Name

Source§

fn clone(&self) -> Name

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Name

Source§

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

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

impl<'de> Deserialize<'de> for Name

Source§

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 Display for Name

Source§

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

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

impl FromStr for Name

Source§

fn from_str(s: &str) -> Result<Name, Self::Err>

Creates a Name from a string slice.

Delegates to Name::parser.

§Errors

Returns an error if Name::parser fails.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl Ord for Name

Source§

fn cmp(&self, other: &Name) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Name

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Name

Source§

fn partial_cmp(&self, other: &Name) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for Name

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Name

Source§

impl StructuralPartialEq for Name