pub struct UpstreamVersionComponent<'a> { /* private fields */ }Expand description
Component of UpstreamVersion, it includes a numeric prefix and a non-numeric suffix.
Implementations§
Source§impl<'a> UpstreamVersionComponent<'a>
impl<'a> UpstreamVersionComponent<'a>
Sourcepub fn new(prefix: Option<u64>, suffix: &'a str) -> UpstreamVersionComponent<'a>
pub fn new(prefix: Option<u64>, suffix: &'a str) -> UpstreamVersionComponent<'a>
Construct a new component.
Sourcepub fn parse(segment: &'a str) -> UpstreamVersionComponent<'a>
pub fn parse(segment: &'a str) -> UpstreamVersionComponent<'a>
Parse a component from segment text.
assert_eq!(UpstreamVersionComponent::parse("").components(), (None, ""));
assert_eq!(
UpstreamVersionComponent::parse("alpha").components(),
(None, "alpha"),
);
assert_eq!(
UpstreamVersionComponent::parse("123").components(),
(Some(123), ""),
);
assert_eq!(
UpstreamVersionComponent::parse("123alpha").components(),
(Some(123), "alpha"),
);
assert_eq!(
UpstreamVersionComponent::parse("0alpha").components(),
(Some(0), "alpha"),
);
assert_eq!(
UpstreamVersionComponent::parse("00alpha").components(),
(Some(0), "alpha"),
);Sourcepub fn components(&self) -> (Option<u64>, &'a str)
pub fn components(&self) -> (Option<u64>, &'a str)
Exact the numeric prefix and non-numeric suffix.
Trait Implementations§
Source§impl<'a> Clone for UpstreamVersionComponent<'a>
impl<'a> Clone for UpstreamVersionComponent<'a>
Source§fn clone(&self) -> UpstreamVersionComponent<'a>
fn clone(&self) -> UpstreamVersionComponent<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for UpstreamVersionComponent<'a>
impl<'a> Debug for UpstreamVersionComponent<'a>
Source§impl<'a> Hash for UpstreamVersionComponent<'a>
impl<'a> Hash for UpstreamVersionComponent<'a>
Source§impl<'a> Ord for UpstreamVersionComponent<'a>
impl<'a> Ord for UpstreamVersionComponent<'a>
Source§fn cmp(&self, other: &UpstreamVersionComponent<'a>) -> Ordering
fn cmp(&self, other: &UpstreamVersionComponent<'a>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for UpstreamVersionComponent<'a>
impl<'a> PartialEq for UpstreamVersionComponent<'a>
Source§fn eq(&self, other: &UpstreamVersionComponent<'a>) -> bool
fn eq(&self, other: &UpstreamVersionComponent<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'a> PartialOrd for UpstreamVersionComponent<'a>
impl<'a> PartialOrd for UpstreamVersionComponent<'a>
impl<'a> Copy for UpstreamVersionComponent<'a>
impl<'a> Eq for UpstreamVersionComponent<'a>
impl<'a> StructuralPartialEq for UpstreamVersionComponent<'a>
Auto Trait Implementations§
impl<'a> Freeze for UpstreamVersionComponent<'a>
impl<'a> RefUnwindSafe for UpstreamVersionComponent<'a>
impl<'a> Send for UpstreamVersionComponent<'a>
impl<'a> Sync for UpstreamVersionComponent<'a>
impl<'a> Unpin for UpstreamVersionComponent<'a>
impl<'a> UnwindSafe for UpstreamVersionComponent<'a>
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Main> IntoAttached for Main
impl<Main> IntoAttached for Main
Source§fn into_attached<Attachment>(
self,
attachment: Attachment,
) -> Attached<Self, Attachment>
fn into_attached<Attachment>( self, attachment: Attachment, ) -> Attached<Self, Attachment>
Attach metadata to an object.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Is for T
impl<T> Is for T
type Type = T
fn into_val(self) -> <T as Is>::Type
fn into_ref(&self) -> &<T as Is>::Type
fn into_mut_ref(&mut self) -> &mut <T as Is>::Type
fn from_val(x: <T as Is>::Type) -> T
fn from_ref(x: &<T as Is>::Type) -> &T
fn from_mut_ref(x: &mut <T as Is>::Type) -> &mut T
Source§impl<X> Pipe for X
impl<X> Pipe for X
Source§fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Returnwhere
Function: FnOnce(&'a Self) -> Return,
Source§fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Returnwhere
Function: FnOnce(&'a mut Self) -> Return,
Source§fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait AsRef<Param>. Read moreSource§fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
fn pipe_as_mut<'a, Param, Return, Function>(&'a mut self, f: Function) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait AsMut<Param>. Read moreSource§fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Deref<Target = Param>. Read moreSource§fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Returnwhere
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait DerefMut<Target = Param>. Read moreSource§fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return
Apply
f to &self where f takes a single parameter of type Param
and Self implements trait Borrow<Param>. Read moreSource§fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function,
) -> Return
fn pipe_borrow_mut<'a, Param, Return, Function>( &'a mut self, f: Function, ) -> Return
Apply
f to &mut self where f takes a single parameter of type Param
and Self implements trait BorrowMut<Param>. Read more