Crate proc_strarray

Source
Expand description

Collection of procedural macros for str operations.

  1. generate const u8 array from str
  2. repeat string
  3. get length of string
  4. generate byte slice from str or byte str

Macros have 0 variant which terminates str literal with \0

Macrosยง

  • Procedural macro proc_strarray::str_array creates const u8 array from str literal.
  • Procedural macro proc_strarray::str_array0 creates zero terminated const u8 array from str literal.
  • Convert string and bytestring literals to byte slice.
  • Convert string and byte string literals to zero terminated byte slice.
  • Procedural macro proc_strarray::str_len returns length of str literal.
  • Procedural macro proc_strarray::str_len0 returns length of zero terminated str literal.
  • Procedural macro proc_strarray::str_repeat repeats string literal n times.
  • Procedural macro proc_strarray::str_repeat0 repeats string literal n times and adds zero termination.