pub struct VersionedRouteConfig {
pub matcher: VersionRange,
pub deprecated: bool,
pub deprecation_message: Option<String>,
pub sunset: Option<String>,
}Expand description
Configuration for a versioned route
Fields§
§matcher: VersionRangeVersion matcher for this route
deprecated: boolWhether this version is deprecated
deprecation_message: Option<String>Deprecation message
sunset: Option<String>Sunset date (RFC 3339)
Implementations§
Source§impl VersionedRouteConfig
impl VersionedRouteConfig
Sourcepub fn version(version: ApiVersion) -> Self
pub fn version(version: ApiVersion) -> Self
Create a new route config for a specific version
Sourcepub fn range(range: VersionRange) -> Self
pub fn range(range: VersionRange) -> Self
Create a route config for a version range
Sourcepub fn deprecated(self) -> Self
pub fn deprecated(self) -> Self
Mark this version as deprecated
Sourcepub fn with_deprecation_message(self, message: impl Into<String>) -> Self
pub fn with_deprecation_message(self, message: impl Into<String>) -> Self
Add a deprecation message
Sourcepub fn with_sunset(self, date: impl Into<String>) -> Self
pub fn with_sunset(self, date: impl Into<String>) -> Self
Set a sunset date
Sourcepub fn matches(&self, version: &ApiVersion) -> bool
pub fn matches(&self, version: &ApiVersion) -> bool
Check if this config matches a version
Trait Implementations§
Source§impl Clone for VersionedRouteConfig
impl Clone for VersionedRouteConfig
Source§fn clone(&self) -> VersionedRouteConfig
fn clone(&self) -> VersionedRouteConfig
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 moreAuto Trait Implementations§
impl Freeze for VersionedRouteConfig
impl RefUnwindSafe for VersionedRouteConfig
impl Send for VersionedRouteConfig
impl Sync for VersionedRouteConfig
impl Unpin for VersionedRouteConfig
impl UnwindSafe for VersionedRouteConfig
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