Skip to main content

alternate_lookup_key

Function alternate_lookup_key 

Source
pub fn alternate_lookup_key(name: &str) -> Option<(&str, Version)>
Expand description

Determines a version-based “alternate lookup key” for the name specified.

Some examples are:

  • foo => None
  • foo:bar/baz => None
  • foo:bar/baz@1.1.2 => Some(foo:bar/baz@1)
  • foo:bar/baz@0.1.0 => Some(foo:bar/baz@0.1)
  • foo:bar/baz@0.0.1 => None
  • foo:bar/baz@0.1.0-rc.2 => None

This alternate lookup key is intended to serve the purpose where a semver-compatible definition can be located, if one is defined, at perhaps either a newer or an older version.