Skip to main content

Module _text

Module _text 

Source
Expand description

Symbolic sequences, encodings, and text processing.
text::{ascii, fmt, layout, parse, str, unicode}

All text module’s items flat re-exported.

Macros§

formatalloc
🖹 🏗️ alloc Creates a String using interpolation of runtime expressions.
format_args
🖹 core Constructs parameters for the other string-formatting macros.
format_buf
🖹 Returns a formatted str slice backed by a buffer, non-allocating.
scalar_offset
🏗️ 𝐓 Defines a compact Unicode scalar type backed by an integer offset.
write
🖹 core Writes formatted data into a buffer.
writeln
🖹 core Writes formatted data into a buffer, with a newline appended.

Structs§

Ascii
𝐓 🛠️ ASCII code-space constants, digit conversions, and lookup data.
AsciiSet
𝐓 A finite set of ASCII characters.
ByteSearch
𝐓 ::= 🛠️ A utility struct for searching bytes in slices.
CStr
𝐓 🍃 core Representation of a borrowed C string (See CString).
CStringalloc
𝐓 alloc An owned, C-compatible, nul-terminated string with no nul bytes in the middle.
Char
𝐓 🛠️ Unicode scalars-related low-level const operations.
CharIter
𝐓 🔄 An iterator over Unicode scalars.
DebugList
🖹 🐛 core A struct to help with Debug implementations.
DebugMap
🖹 🐛 core A struct to help with Debug implementations.
DebugSet
🖹 🐛 core A struct to help with Debug implementations.
DebugStruct
🖹 🐛 core A struct to help with Debug implementations.
DebugTuple
🖹 🐛 core A struct to help with Debug implementations.
DebugWith
🖹 🐛 A Debug adapter for formatting a value with a DebugExt context.
Digits
𝐓 🛠️ Provides ASCII digit operations and conversions for unsigned integer primitives.
Fmt
𝐓 🛠️ A string formatting namespace.
FmtArguments
🖹 core Represents a safely precompiled version of a format string and its arguments.
FmtError
🖹 🚩 core The error type which is returned from formatting a message into a stream.
FmtFromFn
🖹 core Implements Debug and Display via the provided closure.
FmtNum
🖹 🏚️ Const number formatter.
FmtNumConf
🖹 Configuration for numeric formatting.
FmtNumGroup
🖹 Numeric digit grouping configuration.
FmtNumShape
🖹 Describes the structural shape of a formatted number.
FmtWriter
🖹 A specialized formatter with a fixed byte buffer and truncation detection.
Formatter
🖹 core Configuration for formatting.
FromUtf8Erroralloc
𝐓 🚩 alloc A possible error value when converting a String from a UTF-8 byte vector.
GraphemeItergrapheme
𝐓 🔄 Owns grapheme segmentation state while scanning a string slice.
GraphemeMachinegrapheme
𝐓 Streaming EGC boundary detector. Streaming grapheme cluster boundary detector.
GraphemeNonNulgrapheme
𝐓 An EGC backed by a StringNonNul.
GraphemePropsgrapheme
𝐓 Combined EGC break properties for a single code point.
GraphemeScannergrapheme
𝐓 🔄 Borrows grapheme segmentation state while scanning a string slice.
GraphemeStringalloc and grapheme
𝐓 An EGC backed by a String.
GraphemeU8grapheme
𝐓 An EGC backed by a StringU8.
OsStrstd
𝐓 🍃 🖥️ std Borrowed reference to an OS string (See OsString).
OsStringstd
𝐓 🖥️ std A type for owned, mutable native strings, interconvertible with Rust strings.
ParseFloatError
𝐓 ::= 🚩 core An error which can be returned when parsing an float.
ParseIntError
𝐓 ::= 🚩 core An error which can be returned when parsing an integer.
Str
🧶 🛠️ A string slice namespace.
StrBuf
🧶 A borrowed UTF-8 string buffer over caller-provided bytes.
Stringalloc
𝐓 alloc A UTF-8–encoded, growable string.
StringNonNul
🧶 A null-terminated UTF-8 string with up to u8::MAX bytes capacity.
StringSmallAllocalloc
🧶 A UTF-8 string with inline storage and heap spillover.
StringU8
🧶 A UTF-8 string with fixed capacity that stores length explicitly.
TextCursor
𝐓 Continuation point within a caller-defined text traversal.
TextIndex
𝐓 🧱 Position within a caller-defined text-oriented sequence.
TextLayout
𝐓 🧱 🛠️ Text layout engine configuration.
TextLayoutSpan
𝐓 🧱 📏 Mapping between a contiguous text range and its consumed inline space.
TextLayoutStep
𝐓 🧱 ⚖️ Result of a single text layout step.
TextLine
𝐓 🧱 A wrapped visual text line.
TextLineIter
𝐓 🧱 🔄 Iterates fixed-width inline layout steps over a symbol stream.
TextParseError
𝐓 ::= 🚩 A text parsing failure paired with its cursor location.
TextRange
𝐓 📏 A half-open range within a caller-defined text-oriented sequence.
TextScanner
𝐓 ::= A byte-position scanner over source text.
TextSegment
𝐓 🧱 A semantic text segment used for wrapping.
TextSymbol
𝐓 🧱 🔌 Layout participation record for a single text symbol.
TextSymbolConfig
𝐓 🧱 Policy bundle for deriving layout symbols from text.
TextWrapIter
𝐓 🧱 🔄 Iterates wrapped visual lines over text segments.
Textel
𝐓 🧱 🗃️ A discrete textual element for cell-like lines, grids, or canvases.
Translit
𝐓 🛠️ Lossy text transliteration utilities.
char7
𝐓 A 7-bit Unicode scalar, limited to basic latin subset (ASCII).
char8
𝐓 An 8-bit Unicode scalar, limited to basic latin and latin-1 subsets.
char16
𝐓 A 16-bit Unicode scalar, limited to the Basic Multilingual Plane subset.
charu
𝐓 A 32-bit Unicode scalar, with UTF-8 representation.
charu_niche
𝐓 A 32-bit Unicode scalar, with UTF-8 representation, and niche-memory optimization.

Enums§

CharAscii
𝐓 One of 128 Unicode characters (U+0000 to U+007F), the ASCII subset.
FmtAlignment
🖹 core Possible alignments returned by Formatter::align.
FmtNumSign
🖹 Controls how the sign of a number is formatted.
GraphemeBoundarygrapheme
𝐓 Indicates how to handle a code point when detecting grapheme cluster boundaries.
GraphemeKindgrapheme
𝐓 The kinds of supported graphemes.
GraphemePropCbgrapheme
𝐓 EGC property values from Unicode Standard Annex #29.
GraphemePropInCbgrapheme
𝐓 Break property for Indic scripts that prevents splitting within orthographic syllables.
ParseIntErrorKind
𝐓 ::= 🚩 core Kinds of errors that can cause parsing an integer to fail.
TextBreakKind
𝐓 🧱 Reason why a wrapped text line ended.
TextBreakMode
𝐓 🧱 Boundary policy for deriving layout symbols from text.
TextCohesion
𝐓 🧱 Spatial cohesion rules for a text symbol during layout.
TextElideMode
𝐓 🧱 Elision policy for derived layout symbols.
TextFit
𝐓 🧱 ⚖️ Result of testing whether text fits within an inline extent.
TextParseErrorKind
𝐓 ::= 🚩 The category of a text parsing failure.
TextSegmentKind
𝐓 🧱 Segment behavior during text wrapping.
TextelWidth
𝐓 🧱 📏 Cell-like inline extent occupied by a textel.
TextelWidthMode
𝐓 🧱 Width policy for deriving textel inline extent.

Traits§

Binary
🖹 core b formatting.
Debug
🖹 🐛 core ? formatting. (Derivable)
DebugExt
🖹 🐛 Extension for contextual debugging.
Display
🖹 core Format trait for an empty format, {}.
FmtWrite
🖹 core Writing or formatting into Unicode-accepting buffers or streams.
FromStr
𝐓 🍃 core Parse a value from a string.
Graphemegrapheme
𝐓 Common trait for EGC types.
LowerExp
🖹 core e formatting.
LowerHex
🖹 core x formatting.
Octal
🖹 core o formatting.
Pointer
🖹 core p formatting.
StrExt
🧶 Extension trait providing additional methods for &str.
StringExtalloc
🧶 Extension trait providing additional methods for String.
ToStringalloc
𝐓 💱 alloc A trait for converting a value to a String.
UnicodeScalar
𝐓 Common trait for Unicode scalar types.
UpperExp
🖹 core E formatting.
UpperHex
🖹 core X formatting.

Type Aliases§

FmtResult
🖹 ⚖️ The type returned by formatter methods.
TextUnit
𝐓 Basic text-domain unit.
char
⚙️ 𝐓 core A 32-bit Unicode scalar.

Derive Macros§

Debug
🖹 🐛 core ? formatting. (Derivable)