pub enum Ecosystem {
Npm,
Pypi,
Cargo,
Docker,
Go,
Maven,
Nuget,
}Expand description
Package ecosystem identifier for namespace claims.
Args: (no arguments — this is an enum definition)
Usage:
ⓘ
let eco = Ecosystem::parse("crates.io")?;
assert_eq!(eco, Ecosystem::Cargo);
assert_eq!(eco.as_str(), "cargo");Variants§
Npm
Node Package Manager (npmjs.com).
Pypi
Python Package Index (pypi.org).
Cargo
Rust crate registry (crates.io).
Docker
Docker Hub container registry.
Go
Go module proxy (pkg.go.dev).
Maven
Maven Central (Java/JVM).
Nuget
NuGet (.NET).
Implementations§
Source§impl Ecosystem
impl Ecosystem
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Returns the canonical lowercase string identifier for this ecosystem.
Usage:
ⓘ
assert_eq!(Ecosystem::Cargo.as_str(), "cargo");Sourcepub fn parse(s: &str) -> Result<Self, NamespaceVerifyError>
pub fn parse(s: &str) -> Result<Self, NamespaceVerifyError>
Parse an ecosystem string, accepting canonical names and common aliases.
Args:
s: The ecosystem string to parse (case-insensitive).
Usage:
ⓘ
assert_eq!(Ecosystem::parse("crates.io")?, Ecosystem::Cargo);
assert_eq!(Ecosystem::parse("NPM")?, Ecosystem::Npm);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ecosystem
impl<'de> Deserialize<'de> for Ecosystem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Ecosystem
impl Eq for Ecosystem
impl StructuralPartialEq for Ecosystem
Auto Trait Implementations§
impl Freeze for Ecosystem
impl RefUnwindSafe for Ecosystem
impl Send for Ecosystem
impl Sync for Ecosystem
impl Unpin for Ecosystem
impl UnsafeUnpin for Ecosystem
impl UnwindSafe for Ecosystem
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