pub struct DependencyEntry {
pub name: SmolStr,
pub name_range: TextRange,
pub constraint_text: Option<(SmolStr, TextRange)>,
pub constraints: Vec<VersionConstraint>,
pub range: TextRange,
}Expand description
One entry of a dependency field.
Fields§
§name: SmolStrThe entry’s name as written: a package name, or the literal R.
name_range: TextRange§constraint_text: Option<(SmolStr, TextRange)>The text between the parentheses, verbatim, and its range — None when
the entry carries no parenthesized part at all.
constraints: Vec<VersionConstraint>The constraints parsed out of constraint_text, in source order. R
writes one, but a comma-separated pair ((>= 1.0, < 2.0)) is the reason
entry splitting has to be paren-aware, so both are supported.
range: TextRangeThe whole entry’s source range.
Implementations§
Source§impl DependencyEntry
impl DependencyEntry
Sourcepub fn malformed_constraint(&self) -> bool
pub fn malformed_constraint(&self) -> bool
The entry declares a parenthesized part that yielded no constraint — exactly the “unparseable version constraint” case, kept as a fact here and reported as a diagnostic by the consumer.
Sourcepub fn lower_bound(&self) -> Option<&VersionConstraint>
pub fn lower_bound(&self) -> Option<&VersionConstraint>
The first constraint stating a lower bound, which is what a version floor asks for.
Trait Implementations§
Source§impl Clone for DependencyEntry
impl Clone for DependencyEntry
Source§impl Debug for DependencyEntry
impl Debug for DependencyEntry
impl Eq for DependencyEntry
Source§impl Hash for DependencyEntry
impl Hash for DependencyEntry
Source§impl PartialEq for DependencyEntry
impl PartialEq for DependencyEntry
impl StructuralPartialEq for DependencyEntry
Auto Trait Implementations§
impl Freeze for DependencyEntry
impl RefUnwindSafe for DependencyEntry
impl Send for DependencyEntry
impl Sync for DependencyEntry
impl Unpin for DependencyEntry
impl UnsafeUnpin for DependencyEntry
impl UnwindSafe for DependencyEntry
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