Skip to content

Enumeration

KeyPrefixingStrategy

A strategy describing how to apply a prefix to a FieldKey.
enum KeyPrefixingStrategy

Topics

Enumeration Cases

  • KeyPrefixingStrategy.camelCase
    Each key has its first character capitalized and the prefix is applied to the result.
  • KeyPrefixingStrategy.custom(_:)
    A custom strategy - for each key, the closure is called with that key and the prefix with which the wrapper was initialized, and must return the field key to actually use. The closure must be “pure” (i.e. for any given pair of inputs it must always return the same result, in the same way that hash values must be consistent within a single execution context).
  • KeyPrefixingStrategy.none
    The “do nothing” strategy - the prefix is applied to each key by simple concatenation.
  • KeyPrefixingStrategy.snakeCase
    An underscore is placed between the prefix and each key.

Instance Properties

  • description
    A textual representation of this instance.

Instance Methods

  • apply(prefix:to:)
    Apply this prefixing strategy and the given prefix to the given key, and return the result.

Relationships

Conforms To

  • Swift.CustomStringConvertible
  • Swift.Sendable
  • Swift.SendableMetatype