pub struct SdkVersion { /* private fields */ }
Expand description
Represents an SDK version string.
This type attempts to apply semantic versioning onto SDK version strings without pulling in additional crates.
The version string is not validated for correctness at construction time: any string can be stored.
The string is interpreted as a X.Y
or X.Y.Z
semantic version string
where each component is an integer.
For ordering, an invalid string is interpreted as the version 0.0.0
and
therefore should always sort less than a well-formed version.
Implementations§
Source§impl SdkVersion
impl SdkVersion
Sourcepub fn semantic_version(&self) -> Result<String, Error>
pub fn semantic_version(&self) -> Result<String, Error>
Resolve a version string that adheres to Rust’s semantic version string format.
The returned string will have the form X.Y.Z
where all components are
integers.
Trait Implementations§
Source§impl AsRef<str> for SdkVersion
impl AsRef<str> for SdkVersion
Source§impl Clone for SdkVersion
impl Clone for SdkVersion
Source§fn clone(&self) -> SdkVersion
fn clone(&self) -> SdkVersion
Returns a copy 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 Debug for SdkVersion
impl Debug for SdkVersion
Source§impl Display for SdkVersion
impl Display for SdkVersion
Source§impl From<&String> for SdkVersion
impl From<&String> for SdkVersion
Source§impl From<&str> for SdkVersion
impl From<&str> for SdkVersion
Source§impl From<String> for SdkVersion
impl From<String> for SdkVersion
Source§impl Ord for SdkVersion
impl Ord for SdkVersion
Source§impl PartialEq for SdkVersion
impl PartialEq for SdkVersion
Source§impl PartialOrd for SdkVersion
impl PartialOrd for SdkVersion
impl Eq for SdkVersion
impl StructuralPartialEq for SdkVersion
Auto Trait Implementations§
impl Freeze for SdkVersion
impl RefUnwindSafe for SdkVersion
impl Send for SdkVersion
impl Sync for SdkVersion
impl Unpin for SdkVersion
impl UnwindSafe for SdkVersion
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§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.