Skip to main content

SomaFilter

Derive Macro SomaFilter 

Source
#[derive(SomaFilter)]
{
    // Attributes available to this derive:
    #[soma]
}
Expand description

Derive macro for generating config_hash() and Searchable implementations.

§Attributes

§Struct-level

  • #[soma(kind = "Trainable")] - FilterKind (Stateless, Trainable, Opaque)
  • #[soma(cacheable)] or #[soma(cacheable = false)]
  • #[soma(differentiable)] or #[soma(differentiable = false)]
  • #[soma(stream = "FixedState")] - StreamMode

§Field-level

  • #[soma(search(low = 0.1, high = 10.0))] - Float search range
  • #[soma(search(low = 0.1, high = 10.0, scale = "log"))] - With scale
  • #[soma(search(choices = ["a", "b", "c"]))] - Categorical
  • #[soma(search)] - Auto-detect from type (bool → Categorical)
  • #[soma(skip_hash)] - Exclude from config_hash