Replies: 2 comments
-
Aren't |
Beta Was this translation helpful? Give feedback.
-
The largest difference is that Where traits in Rust are nominally typed and thus two traits identical in appearance are not interchangeable. interface Foobar {
foo(): void
bar(): void
}
interface Foo() {
foo(): void
}
function takeFoo(b: Foo) {}
function takeFoobar(f: Foobar) {
takeFoo(f) // Foo is structurally
} This strategy enables the software design practice where developers write packages which define their dependencies as interfaces locally allowing those packages to be entirely self contained. This is partially implemented in Go and fully implemented in TypeScript. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to consider adding support for traits at some point?
Beta Was this translation helpful? Give feedback.
All reactions