pub struct DenoMetadata { /* private fields */ }Expand description
Wraps a Box<dyn Metadata> returned by deps_npm::NpmRegistry::search.
Re-prefixes its name with the npm: scheme (D3) so a
completion item built from it inserts a valid Deno specifier rather than a bare npm
package name.
Needed because Metadata::name cannot be mutated in place on a Box<dyn Metadata> —
this forwards every other method to the wrapped value unchanged.
Implementations§
Source§impl DenoMetadata
impl DenoMetadata
Sourcepub fn new(name: PackageName, inner: Box<dyn Metadata>) -> DenoMetadata
pub fn new(name: PackageName, inner: Box<dyn Metadata>) -> DenoMetadata
Wraps inner, overriding its reported name with the already scheme-qualified
name.
Trait Implementations§
Source§impl Metadata for DenoMetadata
impl Metadata for DenoMetadata
Source§fn name(&self) -> &PackageName
fn name(&self) -> &PackageName
The package name as the registry reports it. Read more
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Short description (optional).
Source§fn repository(&self) -> Option<&str>
fn repository(&self) -> Option<&str>
Repository URL (optional).
Source§fn documentation(&self) -> Option<&str>
fn documentation(&self) -> Option<&str>
Documentation URL (optional).
Source§fn latest_version(&self) -> &ConcreteVersion
fn latest_version(&self) -> &ConcreteVersion
Latest stable version.
Auto Trait Implementations§
impl !RefUnwindSafe for DenoMetadata
impl !UnwindSafe for DenoMetadata
impl Freeze for DenoMetadata
impl Send for DenoMetadata
impl Sync for DenoMetadata
impl Unpin for DenoMetadata
impl UnsafeUnpin for DenoMetadata
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
§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