Expand description
Cairo utilities.
Modules§
Macros§
- Macro to verify an expression matches a pattern and extract its fields.
- Macro to try to evaluate an expression as a pattern and extract its fields.
Traits§
- A trait for the
lookup_intern
method for short IDs (returning the long ID). - Similar to From / TryFrom, but returns an option.
- Helper operations on
Option<T>
.
Functions§
- Borrows a mutable reference as Box for the lifespan of this function. Runs the given closure with the boxed value as a parameter. The closure is expected to return a boxed value, whose changes will be reflected on the mutable reference. Example:
- Returns
Some(())
if the condition is true, otherwiseNone
. Useful in functions returningNone
on some condition:require(condition)?;
And for functions returningErr
on some condition:require(condition).ok_or_else(|| create_err())?;