Skip to content

Main content

Cargo Feature Dependency Prefix Token Tool

Compute cargo feature dependency prefix token from explicit bounded inputs.

Loading tool…

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

  1. Enter token. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
tokenTokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
dependencyDependencyRequired. Text; maximum UTF-16 length 8192.
featureFeatureRequired. Text; maximum UTF-16 length 8192.
optionalOptionalRequired. Boolean.
json
{
  "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

  1. Calculation and input contract: development/cargo-feature-dependency-prefix-token — tool.io

Similar or alternative tools