pub struct VersionConstraint {
pub expression: String,
pub allow_prerelease: bool,
}
Expand description
Version constraint specification
Fields§
§expression: String
Constraint expression (e.g., “>=1.0.0”, “^2.1.0”, “~1.2.3”)
allow_prerelease: bool
Whether to allow prerelease versions
Implementations§
Source§impl VersionConstraint
impl VersionConstraint
Sourcepub fn with_prerelease(expression: impl Into<String>) -> Self
pub fn with_prerelease(expression: impl Into<String>) -> Self
Create a version constraint that allows prerelease versions
Sourcepub fn is_satisfied_by(&self, version: &str) -> bool
pub fn is_satisfied_by(&self, version: &str) -> bool
Check if this constraint is satisfied by a version
Trait Implementations§
Source§impl Clone for VersionConstraint
impl Clone for VersionConstraint
Source§fn clone(&self) -> VersionConstraint
fn clone(&self) -> VersionConstraint
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 Debug for VersionConstraint
impl Debug for VersionConstraint
Source§impl<'de> Deserialize<'de> for VersionConstraint
impl<'de> Deserialize<'de> for VersionConstraint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VersionConstraint
impl RefUnwindSafe for VersionConstraint
impl Send for VersionConstraint
impl Sync for VersionConstraint
impl Unpin for VersionConstraint
impl UnwindSafe for VersionConstraint
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