# Function rustc_demangle::try_demangle [−] [src]

    pub fn try_demangle(s: &str) -> Result<Demangle, TryDemangleError>

The same as `demangle`, except return an `Err` if the string does not appear to be a Rust symbol, rather than "demangling" the given string as a no-op.

    extern crate rustc_demangle;

    let not_a_rust_symbol = "la la la";

    // The `try_demangle` function will reject strings which are not Rust symbols.
    assert!(rustc_demangle::try_demangle(not_a_rust_symbol).is_err());

    // While `demangle` will just pass the non-symbol through as a no-op.
    assert_eq!(rustc_demangle::demangle(not_a_rust_symbol).as_str(), not_a_rust_symbol);

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)