Description
Parse one restricted Cargo dependency-feature token.
Package and container references combine names, selectors, conditions and platform metadata. A restricted lexical split can preserve these parts without validating registry identity, available targets, dependency graphs or runtime resolution.
Parse one restricted Cargo dependency-feature token.
When to use this tool
Use Cargo Feature Dependency Prefix Token when checking the stated package, Cargo or container-reference component.
How to use the tool and how it works
- Enter token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read dependency, feature, optional. Inspect optional before interpreting the associated values.
Parse one restricted Cargo dependency-feature token. Accept dep:name or dependency/feature with optional question mark before slash; return dependency, feature or empty text, and optional from that question mark.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| dependency | Dependency | Required. Text; maximum UTF-16 length 8192. |
| feature | Feature | Required. Text; maximum UTF-16 length 8192. |
| optional | Optional | Required. Boolean. |
{
"input": {
"token": "serde?/derive"
},
"output": {
"dependency": "serde",
"feature": "derive",
"optional": true
}
} Limitations and assumptions
- dep: alone does not set optional; dependency declarations and feature availability are not checked.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the relevant package manager, runtime or registry against the actual project for complete resolution and validation.
References
Similar or alternative tools
- Cargo Dependency Rename Package Pair
Compare local and package names in a Cargo rename record.
- Cargo Profile Inheritance Key
Classify a Cargo profile and supplied inheritance parent.