error unknown-method
У типа нет такого метода.
What it means#
The method is not declared in an impl of the type, is not promoted from an embedded type (§4.7), and is not a default method of an interface the type satisfies (§4.6).
Example#
data User { name: str }
fn main() {
let u = User{ name: "Ann" }
u.greet() // <- unknown-method
}error
unknown-method
How to fix#
data User { name: str }
impl User {
fn greet() -> str => "Hello, {name}"
}
fn main() {
let u = User{ name: "Ann" }
print(u.greet())
}Declare the method in an impl block, or call an existing one.