pub struct ApiVersion { /* private fields */ }Expand description
One advertised API version, preserving the wire spelling.
Implementations§
Source§impl ApiVersion
impl ApiVersion
Sourcepub fn parse(text: &str) -> Result<Self, ModelError>
pub fn parse(text: &str) -> Result<Self, ModelError>
Sourcepub fn parse_lenient(text: &str) -> Result<Self, ModelError>
pub fn parse_lenient(text: &str) -> Result<Self, ModelError>
Parse a SemVer version, or a short MAJOR / MAJOR.MINOR form.
1 is read as 1.0.0 and 1.2 as 1.2.0 for comparison. The
advertised spelling is kept for Self::as_str, so the request path
stays /v1/ for a server that advertised 1. Used only when the
client is configured with lenient versions; see
SupportedApi::with_lenient.
§Errors
Returns an error when the text is neither SemVer 2.0.0 nor a short numeric form without leading zeros.
Trait Implementations§
Source§impl Clone for ApiVersion
impl Clone for ApiVersion
Source§impl Debug for ApiVersion
impl Debug for ApiVersion
Source§impl Display for ApiVersion
impl Display for ApiVersion
impl Eq for ApiVersion
Source§impl PartialEq for ApiVersion
impl PartialEq for ApiVersion
impl StructuralPartialEq for ApiVersion
Auto Trait Implementations§
impl Forget for ApiVersion
impl Freeze for ApiVersion
impl RefUnwindSafe for ApiVersion
impl Send for ApiVersion
impl Sync for ApiVersion
impl Unpin for ApiVersion
impl UnsafeUnpin for ApiVersion
impl UnwindSafe for ApiVersion
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