strck_ident

Module rust

source
Expand description

Checked strings containing Rust identifiers.

Raw identifiers are unsupported.

§Examples

use strck_ident::{IntoCk, rust::RustIdent};

assert!("foo".ck::<RustIdent>().is_ok());
assert!("_identifier".ck::<RustIdent>().is_ok());
assert!("Москва".ck::<RustIdent>().is_ok());
assert!("東京".ck::<RustIdent>().is_ok());

assert!("struct".ck::<RustIdent>().is_err());
assert!("r#try".ck::<RustIdent>().is_err());
assert!("👍".ck::<RustIdent>().is_err());

§Aliases

This module exposes Ident and IdentBuf, which alias Ck<RustIdent> and Check<RustIdent> respectively. These aliases are preferred to keep type signatures succinct.

§Requirements

This module is only available when the rust feature flag is enabled.

Structs§

Enums§

  • The error type returned from checking the invariants of RustIdent.

Statics§

Type Aliases§

  • Borrowed checked string containing a Rust identifier.
  • Owned checked string containing a Rust identifier.