Struct BuildMetadata

pub struct BuildMetadata { /* private fields */ }

Optional build metadata identifier. This comes after + in a SemVer version, as in 0.8.1+zstd.1.5.0.

Examples

Some real world build metadata idioms drawn from crates.io:

Syntax

Build metadata is a series of dot separated identifiers immediately following the patch or pre-release version. Identifiers must comprise only ASCII alphanumerics and hyphens: 0-9, A-Z, a-z, -. Identifiers must not be empty. Leading zeros are allowed, unlike any other place in the SemVer grammar.

Total ordering

Build metadata is ignored in evaluating VersionReq; it plays no role in whether a Version matches any one of the comparison operators.

However for comparing build metadatas among one another, they do have a total order which is determined by lexicographic ordering of dot-separated components. Identifiers consisting of only digits are compared numerically. Otherwise, identifiers are compared in ASCII sort order. Any numeric identifier is always less than any non-numeric identifier.

Example: demo < demo.85 < demo.90 < demo.090 < demo.200 < demo.1a0 < demo.a < memo

Implementations

impl BuildMetadata

const EMPTY: Self = _;
fn new(text: &str) -> Result<Self, Error>
fn as_str(&self) -> &str
fn is_empty(&self) -> bool

Trait Implementations

impl Clone for BuildMetadata

fn clone(&self) -> BuildMetadata

impl Debug for BuildMetadata

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

impl Default for BuildMetadata

fn default() -> BuildMetadata

impl Deref for BuildMetadata

type Target = str;
fn deref(&self) -> &Self::Target

impl Display for BuildMetadata

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

impl Eq for BuildMetadata

impl FromStr for BuildMetadata

type Err = Error;
fn from_str(text: &str) -> Result<Self, Self::Err>

impl Hash for BuildMetadata

fn hash<__H: Hasher>(&self, state: &mut __H)

impl Ord for BuildMetadata

fn cmp(&self, rhs: &Self) -> Ordering

impl PartialEq for BuildMetadata

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

impl PartialOrd for BuildMetadata

fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>

impl StructuralPartialEq for BuildMetadata

Auto Trait Implementations

impl Freeze for BuildMetadata

impl RefUnwindSafe for BuildMetadata

impl Send for BuildMetadata

impl Sync for BuildMetadata

impl Unpin for BuildMetadata

impl UnsafeUnpin for BuildMetadata

impl UnwindSafe for BuildMetadata

Blanket Implementations

impl<P, T> Receiver for BuildMetadata where P: Deref<Target = T> + ?Sized, T: ?Sized,

type Target = T;

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for BuildMetadata where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for BuildMetadata

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for BuildMetadata where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> ToString for BuildMetadata where T: Display + ?Sized,

fn to_string(&self) -> String

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for BuildMetadata where U: TryFrom<T>,

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