Skip to main content

turso_assert_some

Macro turso_assert_some 

Source
turso_assert_some!() { /* proc-macro */ }
Expand description

Asserts that at least one of multiple named conditions is true whenever this line is reached (logical OR). All conditions are evaluated.

§Behavior

  • Without antithesis feature: panics if none of the conditions are true (like assert!).
  • With antithesis feature: reports the property to Antithesis via assert_always_or_unreachable!. On failure, prints the error to stderr and calls std::process::exit(0) instead of panicking.

§Parameters

  • {name: condition, ...} — named boolean conditions in curly braces. Names are labels for Antithesis reporting.
  • "message" — human-readable description (required).
  • { "key": value, ... } (optional) — structured details for Antithesis.

§Usage

turso_assert_some!(
    {is_leaf: page.is_leaf(), is_interior: page.is_interior()},
    "page must be either leaf or interior"
);

turso_assert_some!(
    {has_data: !row.is_empty(), has_rowid: row.rowid().is_some()},
    "row must have data or a rowid",
    { "table": table_name }
);

§When to use

Use whenever a condition has a logical OR.