cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
cwist_bind_rule Struct Reference

Single validation rule attached to a field. More...

#include <bind.h>

Public Attributes

cwist_bind_rule_type_t type
 
union { 
 
   size_t   min_len 
 For MIN_LEN. More...
 
   size_t   max_len 
 For MAX_LEN. More...
 
   long double   min_val 
 For MIN_VAL. More...
 
   long double   max_val 
 For MAX_VAL. More...
 
   const char *   pattern 
 For REGEX (static string, compiled once). More...
 
   struct { 
 
      bool(*   fn )(const char *value, size_t
         len, void *ctx) 
 
      void *   ctx 
 
   }   custom 
 For CUSTOM. More...
 
} u 
 
const char * error_message
 Optional override for the default error text.
 

Detailed Description

Single validation rule attached to a field.

Definition at line 45 of file bind.h.

Member Data Documentation

◆ ctx

void* cwist_bind_rule::ctx

Definition at line 55 of file bind.h.

◆ [struct]

struct { ... } cwist_bind_rule::custom

For CUSTOM.

◆ error_message

const char* cwist_bind_rule::error_message

Optional override for the default error text.

Definition at line 58 of file bind.h.

◆ fn

bool(* cwist_bind_rule::fn) (const char *value, size_t len, void *ctx)

Definition at line 54 of file bind.h.

◆ max_len

size_t cwist_bind_rule::max_len

For MAX_LEN.

Definition at line 49 of file bind.h.

◆ max_val

long double cwist_bind_rule::max_val

For MAX_VAL.

Definition at line 51 of file bind.h.

◆ min_len

size_t cwist_bind_rule::min_len

For MIN_LEN.

Definition at line 48 of file bind.h.

◆ min_val

long double cwist_bind_rule::min_val

For MIN_VAL.

Definition at line 50 of file bind.h.

◆ pattern

const char* cwist_bind_rule::pattern

For REGEX (static string, compiled once).

Definition at line 52 of file bind.h.

◆ type

cwist_bind_rule_type_t cwist_bind_rule::type

Definition at line 46 of file bind.h.

◆ [union]

union { ... } cwist_bind_rule::u

The documentation for this struct was generated from the following file: