framework/spec

Declarative value constraints. Values are wrapped by generated types.

Types

pub type Error {
  Invalid
}

Constructors

  • Invalid
pub type Spec {
  Uuid
  Pattern(min: Int, max: Int, regex: String)
  Text(min: Int, max: Int)
  Markdown
  MarkdownText(min: Int, max: Int)
  Range(min: Int, max: Int)
  Url
}

Constructors

  • Uuid
  • Pattern(min: Int, max: Int, regex: String)
  • Text(min: Int, max: Int)
  • Markdown
  • MarkdownText(min: Int, max: Int)
  • Range(min: Int, max: Int)
  • Url

Values

pub fn validate(raw: String, spec: Spec) -> Result(String, Error)
Search Document