What is "trait bounds" exact meaning?

Hi there, I started to learn Rust by the official book these days.
And I found the word "trait bound" in the chapter 10-2. What is the exact meaning? (I'm not an English speaker)

Especially I can't understand the "bound" part. Does it mean "bind"? Or does it mean "the border for the distinct from others"?

Borders, yes. In mathematics you might hear about “upper and lower bounds” for a numeric variable — it's the same sort of thing, setting boundaries for what values (types) the type-variable may take on.

In the same way that you define parameter types for function parameters, you can define "trait bounds" for generic type parameters. It limits the possible types that can be used for a generic type parameter.

1 Like

@kpreid @geebee22 Thank you guys for the quick answers.
Now I understand the actual meaning of it!

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.