Crate const_str

source ·
Expand description

Compile-time string operations

MSRV: Rust 1.65.0

Macros§

  • Compares two strings lexicographically.
  • Concatenates values into a string slice.
  • Concatenates values into a byte slice.
  • Returns true if the given pattern matches a sub-slice of this string slice.
  • Converts a string slice to a specified case. Non-ascii characters are not affected.
  • convert_caseproc or case
    Converts a string literal to a specified case.
  • Converts a string slice to &CStr.
  • Encode a string slice with a specified encoding.
  • Encode a string slice with a specified encoding and append a nul character.
  • Returns true if the given pattern matches a suffix of this string slice.
  • Checks that two (string) slices are an ASCII case-insensitive match.
  • Checks that two strings are equal.
  • formatproc
    Creates a string slice using interpolation of const expressions.
  • Converts a byte string to a string slice
  • Converts hexadecimal string slices to a byte array.
  • Converts a string slice to an IP address.
  • Checks if all characters in this (string) slice are within the ASCII range.
  • Concatenates string slices into a string slice, separated by a given separator.
  • Parse a value from a string slice.
  • Converts a string slice to *const c_char.
  • Asserts that the string literal matches the pattern.
  • Creates a new string slice by repeating a string slice n times.
  • Replaces all matches of a pattern with another string slice.
  • Sorts string slices and returns a new array.
  • Returns an array of substrings of a string slice, separated by characters matched by a pattern.
  • Splits the string by ASCII whitespaces, and then joins the parts with a single space.
  • Returns true if the given pattern matches a prefix of this string slice.
  • Returns a string slice with the prefix removed.
  • Returns a string slice with the suffix removed.
  • Converts a string slice or a byte string to a byte array.
  • Converts a string slice into an array of its characters.
  • Converts a value to a string slice.
  • Unwraps a container, returns the content.
  • Returns a compile-time verified header name string literal.
  • Returns a compile-time verified regex string literal.