Error code E0118
An inherent implementation was defined for something which isn't a struct, enum, union, or trait object.
Erroneous code example:
ⓘ
To fix this error, please implement a trait on the type or wrap it in a struct. Example:
Alternatively, you can create a newtype. A newtype is a wrapping tuple-struct.
For example, NewType
is a newtype over Foo
in struct NewType(Foo)
.
Example: