[][src]Crate spinoso_symbol

Identifier for interned bytestrings and routines for manipulating the underlying bytestrings.

Symbol is a Copy type based on u32. Symbol is cheap to copy, store, and compare. It is suitable for representing indexes into a string interner.

Artichoke integration

This crate has an artichoke Cargo feature. When this feature is active, this crate implements the Symbol API from Ruby Core. These APIs require resolving the underlying bytes associated with the Symbol via a type that implements Intern from artichoke-core.

APIs that require this feature to be active are highlighted in the documentation.

This crate provides an AllSymbols iterator for walking all symbols stored in an Interner and an extension trait for constructing it which is suitable for implementing Symbol::all_symbols from Ruby Core.

This crate provides an Inspect iterator for converting Symbol byte content to a debug representation suitable for implementing Symbol#inspect from Ruby Core.

no_std

This crate is no_std compatible when built without the std feature. This crate does not depend on alloc.

Crate features

All features are enabled by default.

Structs

AllSymbolsartichoke

An iterator that returns all of the Symbols in an interner.

Inspectinspect

An iterator that yields a debug representation of a Symbol and its byte contents as a sequence of chars.

NoSuchCaseFoldingSchemeartichoke

Error type for returned when a folding scheme could not be resolved in a TryFrom implementation.

ParseIdentifierError

Error type returned from the FromStr implementation on IdentifierType.

Symbol

Identifier bound to an interned bytestring.

SymbolOverflowError

Error returned when a symbol identifier overflows.

Enums

CaseFoldartichoke

Unicode case folding strategies.

IdentifierType

Valid types for Ruby identifiers.

Traits

InternerAllSymbolsartichoke

Extension trait to return an iterator that returns all symbol identifiers stored in an interner as Symbols.

Functions

ascii_casecmpartichoke

Compare the byte contents of two symbols using ASCII case-insensitive comparison.

unicode_case_eqartichoke

Compare the byte contents of two symbols using Unicode case-folding comparison for equality.