What does this trait syntax mean?

Hello the syntax I am struggling with is this

pub trait WebDriverHandler<U: WebDriverExtensionRoute = VoidWebDriverExtensionRoute>: Send {...}

In particular I don't understand what the equal sign is doing. I also don't understand what : Send means. All help would be appreciated, thank you.
Source: https://hg.mozilla.org/mozilla-central/file/tip/testing/webdriver/src/server.rs

The type after the equal sign is a default for the type parameter. It will be used automatically if you don't specify a type parameter for the trait explicitly.

The : Send part means that whatever type implement this trait, it must also implement Send. I.e. it's syntactic sugar for where Self: Send, with an inheritance-like syntax for reasons of familiarity.

1 Like

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.