Trait Visitor
trait Visitor: Sized + private::Sealed
Variable visitor.
See [the module documentation][self] for usage.
Associated Types
type ResultResult of the visit.
type ListVisitor: TraitBound { trait_: Path { path: "ListVisitor", id: Id(838), args: Some(AngleBracketed { args: [], constraints: [AssocItemConstraint { name: "Result", args: None, binding: Equality(Type(QualifiedPath { name: "Result", args: None, self_type: Generic("Self"), trait_: Some(Path { path: "", id: Id(794), args: None }) })) }] }) }, generic_params: [], modifier: None }List visitor.
type AssocVisitor: TraitBound { trait_: Path { path: "AssocVisitor", id: Id(840), args: Some(AngleBracketed { args: [], constraints: [AssocItemConstraint { name: "Result", args: None, binding: Equality(Type(QualifiedPath { name: "Result", args: None, self_type: Generic("Self"), trait_: Some(Path { path: "", id: Id(794), args: None }) })) }] }) }, generic_params: [], modifier: None }Associative array visitor.
Required Methods
fn var_name(self: &Self) -> VarName<'_>Returns the name of the variable to visit.
fn purpose(self: &Self) -> VisitPurposeReturns the purpose of the visit.
The template expansion algorithm checks the types for some variables depending on its usage. To get the usage count correctly, you should only count visits with
VisitPurpose::Expand.If you need to know whether the variable is accessed and does not need dynamic context generation or access counts, consider using
UriTemplateStr::variablesmethod to iterate the variables in the URI template.fn visit_undefined(self: Self) -> <Self as >::ResultVisits an undefined variable, i.e. indicates that the requested variable is unavailable.
fn visit_string<T: fmt::Display>(self: Self, v: T) -> <Self as >::ResultVisits a string variable.
fn visit_list(self: Self) -> <Self as >::ListVisitorVisits a list variable.
fn visit_assoc(self: Self) -> <Self as >::AssocVisitorVisits an associative array variable.