pub struct DenoDependency {
pub name: PackageName,
pub name_range: Range,
pub version_req: Option<VersionReq>,
pub version_range: Option<Range>,
pub section: DenoDependencySection,
}Expand description
A parsed Deno import, scheme-qualified (D2).
name is "jsr:@std/fs" or "npm:react" — never the bare form — since
crate::registry::DenoRegistry can only route a lookup to the right registry if the
scheme travels with the name.
§Examples
use deps_deno::types::{DenoDependency, DenoDependencySection};
use tower_lsp_server::ls_types::{Position, Range};
let dep = DenoDependency {
name: "jsr:@std/fs".into(),
name_range: Range::new(Position::new(2, 4), Position::new(2, 15)),
version_req: Some("^1.0".into()),
version_range: Some(Range::new(Position::new(2, 17), Position::new(2, 21))),
section: DenoDependencySection::Imports,
};
assert_eq!(dep.name, "jsr:@std/fs");Fields§
§name: PackageNameScheme-qualified package name ("jsr:@std/fs", "npm:react").
name_range: RangeLSP range of name within the manifest, including the scheme: prefix.
version_req: Option<VersionReq>Version requirement, if the specifier carried one (@1.2, @^18).
version_range: Option<Range>LSP range of version_req within the manifest, if present.
section: DenoDependencySectionWhich section of the manifest this import was declared in.
Trait Implementations§
Source§impl Clone for DenoDependency
impl Clone for DenoDependency
Source§fn clone(&self) -> DenoDependency
fn clone(&self) -> DenoDependency
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DenoDependency
impl Debug for DenoDependency
Source§impl Dependency for DenoDependency
impl Dependency for DenoDependency
Source§fn name(&self) -> &PackageName
fn name(&self) -> &PackageName
Package name
Source§fn name_range(&self) -> Range
fn name_range(&self) -> Range
LSP range of the dependency name
Source§fn version_requirement(&self) -> Option<&VersionReq>
fn version_requirement(&self) -> Option<&VersionReq>
Version requirement string (e.g., “^1.0”, “>=2.0”)
Source§fn version_range(&self) -> Option<Range>
fn version_range(&self) -> Option<Range>
LSP range of the version string
Source§fn source(&self) -> DependencySource
fn source(&self) -> DependencySource
Dependency source (registry, git, path)
Source§fn features_range(&self) -> Option<Range>
fn features_range(&self) -> Option<Range>
LSP range of the features array (ecosystem-specific, None if not supported)
Source§fn markers(&self) -> Option<&str>
fn markers(&self) -> Option<&str>
Environment marker expression gating this dependency (e.g. PEP 508’s
python_version >= '3.8'). Ecosystem-specific, None if not supported
or not present on this dependency.Source§fn markers_range(&self) -> Option<Range>
fn markers_range(&self) -> Option<Range>
LSP range of the environment marker expression (ecosystem-specific,
None if not supported or not present).Source§fn version_literal(&self) -> Option<&str>
fn version_literal(&self) -> Option<&str>
impl Eq for DenoDependency
Source§impl PartialEq for DenoDependency
impl PartialEq for DenoDependency
Source§fn eq(&self, other: &DenoDependency) -> bool
fn eq(&self, other: &DenoDependency) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DenoDependency
Auto Trait Implementations§
impl Freeze for DenoDependency
impl RefUnwindSafe for DenoDependency
impl Send for DenoDependency
impl Sync for DenoDependency
impl Unpin for DenoDependency
impl UnsafeUnpin for DenoDependency
impl UnwindSafe for DenoDependency
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more