Module context
Template expansion context.
Examples
- Define your context type.
- Implement
Contexttrait (andContext::visitmethod) for the type.- Get variable name by
Visitor::var_namemethod. - Feed the corresponding value(s) by one of
Visitor::visit_*methods.
- Get variable name by
Note that contexts should return consistent result across multiple visits for
the same variable. In other words, Context::visit should return the same
result for the same Visitor::var_name() during the context is borrowed.
If this condition is violated, the URI template processor can return
invalid result or panic at worst.
use ;
Structs
- VarName Variable name.
Enums
- VisitPurpose A purpose of a visit.
Traits
- AssocVisitor Associative array visitor.
- Context A trait for types that can behave as a static URI template expansion context.
- DynamicContext A trait for types that can behave as a dynamic (mutable) URI template expansion context.
- ListVisitor List visitor.
- Visitor Variable visitor.