Crate ranting

source ·
Expand description

Functions to handle Ranting trait placeholders.

Feature flags

  • debug — Print during compilation each say!() pattern with its format!() conversion.

Macros

  • A wrapper for return Ok(say!())
  • If you want to implement Ranting on a Box<&dyn Trait> where Trait has Ranting
  • A wrapper for return Err(say!())
  • If you want to implement Ranting on a &'_ dyn Trait where Trait has Ranting
  • Functions like format!() for normal placeholders, but allows extended placeholders including e.g. articles or verbs beside a Noun or a variable with the Ranting trait. These are inflected accordingly, and adjustable by punctuation prefixes.

Structs

  • Has the Ranting trait. Often you may want to #[derive(Ranting)] and sometimes override some of the trait functions.

Traits

  • The trait required for a struct or enum to function as a noun in a placeholder, derived with #[derive_ranting]. Functions are used in say!() placeholders replacements.

Functions

  • The say macro parses placeholders and passes captures to this function which returns a string.
  • Inflect possesive pronoun as to_plural indicates. The first character capitalized with uc set.
  • return whether the given &str is a valid subject
  • Returns whether the subjective is plural. You is assumed singular; a plural_you ranting attribute should already be considered before this call.
  • upper cases first character if uc is true, or second in a contraction.