Using GenericArgsBinding and GenericArgsBound in "path in expression"

Hi

Look at this link. I need a real example of how GenericArgsBinding and GenericArgsBound are used in a path. Also please explain the behavior.

Thank you all.

GenericArgsBinding is used in Trait<Arg = Type>, like in the definition for Iterator::chain:

IntoIterator<Item = Self::Item>

GenericAgrsBound is used in Type<Arg: Trait>; I can't find any real-world example off the top of my head, but it's the same syntax that is used in where Type: Trait context.

As for "behavior" - there's no single behavior for this syntax, since paths can be used in different contexts.

1 Like

I was exactly looking for some real example for GenericArgsBound!! Because GenericArgsBinding was almost obvious.

I know that Arg: Trait is only possible between traits, that is, if a trait branches off from another trait, the parent can only specify a bound for it instead of specifying the exact associated type, so that the Trait is the child or even the impl that specifies the exact type. But how do you refer to raw Trait in Path?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.