# GuardedStruct v0.1.0-beta.1 - Table of Contents

Build Elixir structs with validation, sanitization, nested sub-structs, conditional fields, pattern-keyed maps, and an Ash extension. Built on Spark.

## Pages

- [README](readme.md)
- [Changelog for GuardedStruct 0.1.0](changelog.md)
- [Security Policy](security.md)
- [LICENSE](license.md)

- Guidance
  - [GuardedStruct](guarded-struct.md)

- Agent Usage Rules
  - [GuardedStruct](usage-rules.md)
  - [GuardedStruct DSL — field, sub_field, conditional_field, virtual_field, dynamic_field](dsl.md)
  - [Derive ops — sanitize(...) and validate(...) mini-language](derive.md)
  - [conditional_field — runtime child dispatch](conditional.md)
  - [Custom validators — validator: and main_validator:](validators.md)
  - [Cross-field core keys — auto, from, on, domain](core-keys.md)
  - [Custom derive extensions — use GuardedStruct.Derive.Extension](extensions.md)
  - [Ash integration — GuardedStruct.AshResource](ash.md)
  - [Runtime API — Builder, Validate, Diff, Info](api.md)
  - [Errors — canonical shape and Splode wrapping](errors.md)

- DSL Reference
  - [GuardedStruct](dsl-guardedstruct.md)
  - [GuardedStruct.AshResource](dsl-guardedstruct-ashresource.md)
  - [GuardedStruct.Derive.Extension](dsl-guardedstruct-derive-extension.md)

## Modules

- [GuardedStruct.AshResource.Change](GuardedStruct.AshResource.Change.md): An `Ash.Resource.Change` module that plugs `__guarded_change__/1` into the
Ash changeset pipeline.
- [GuardedStruct.Diff](GuardedStruct.Diff.md): Field-level diffs between two GuardedStruct instances.
- [GuardedStruct.Helper.Extra](GuardedStruct.Helper.Extra.md)
- [GuardedStruct.Derive.SanitizerDerive](GuardedStruct.Derive.SanitizerDerive.md): Built-in sanitizer ops. Every clause follows the pipe-friendly
`sanitize(value, op)` argument order
- [GuardedStruct.Derive.ValidationDerive](GuardedStruct.Derive.ValidationDerive.md)

- Core
  - [GuardedStruct](GuardedStruct.md): GuardedStruct macro: build structs with validation, sanitization, constructors,
and nested-struct support.
  - [GuardedStruct.Info](GuardedStruct.Info.md): Runtime introspection of guardedstruct DSL state.

- Validation
  - [GuardedStruct.Validate](GuardedStruct.Validate.md): Standalone validators that reuse a `GuardedStruct` schema without going
through the full `builder/1` pipeline.

- Errors (Splode)
  - [GuardedStruct.Errors](GuardedStruct.Errors.md): Splode error aggregator for GuardedStruct runtime errors.
  - [GuardedStruct.Errors.Validation](GuardedStruct.Errors.Validation.md): Single field-level validation error.

- Extensions
  - [GuardedStruct.AshResource](GuardedStruct.AshResource.md): A Spark DSL extension that adds the GuardedStruct DSL to an Ash resource.
  - [GuardedStruct.AshResource.Info](GuardedStruct.AshResource.Info.md): Runtime introspection for the `GuardedStruct.AshResource` extension.
  - [GuardedStruct.Derive.Extension](GuardedStruct.Derive.Extension.md): Define custom derive validators / sanitizers via a Spark DSL.

- i18n
  - [GuardedStruct.Messages](GuardedStruct.Messages.md): This module is used to define the messages that are used in the guarded_struct library.
You can define your own messages by creating a module that uses this module and
implements the callbacks defined in this module.
It can be used to define messages in multiple languages like using Gettext.

## Mix Tasks

- [mix guarded_struct.install](Mix.Tasks.GuardedStruct.Install.md): One-command project setup for guarded_struct

