pub trait Metadata: Send + Sync {
// Required methods
fn name(&self) -> &PackageName;
fn description(&self) -> Option<&str>;
fn repository(&self) -> Option<&str>;
fn documentation(&self) -> Option<&str>;
fn latest_version(&self) -> &ConcreteVersion;
fn as_any(&self) -> &dyn Any;
}Expand description
Package metadata trait.
Used for completion items and hover documentation.
Required Methods§
Sourcefn name(&self) -> &PackageName
fn name(&self) -> &PackageName
The package name as the registry reports it.
This is the identifier the registry displays and that completion
pastes into a manifest. It is not guaranteed byte-identical to the
manifest-declared Dependency::name
for the same package: casing may differ (NuGet, Composer, Swift), and
for Maven/Gradle it is a "group:artifact" value synthesized from two
separate response fields. Do not compare it to a manifest name
without going through
PackageNaming::normalize_package_name.
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Short description (optional).
Sourcefn repository(&self) -> Option<&str>
fn repository(&self) -> Option<&str>
Repository URL (optional).
Sourcefn documentation(&self) -> Option<&str>
fn documentation(&self) -> Option<&str>
Documentation URL (optional).
Sourcefn latest_version(&self) -> &ConcreteVersion
fn latest_version(&self) -> &ConcreteVersion
Latest stable version.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".