Cairo Use Keyword
Overview
Guide use statements for ergonomic imports and re-exports.
Quick Use
- •Read
references/use-keyword.mdbefore answering. - •Show idiomatic imports for functions (parent module) and types (full path).
- •Use
asfor name conflicts.
Response Checklist
- •Place
useat the top of the module where it is needed. - •Use grouped imports with braces when bringing in multiple items.
- •Use
pub useto re-export items from a module.
Example Requests
- •"How do I shorten this long module path?"
- •"How do I import two items from the same module?"
- •"How do I re-export a module's function?"