What's the best way to create a stub function in Rust? Something like:
fn my_method() -> bool {
return new UnImplementedException() //wrong! But that's close to what I need
}
In C# the methods can return UnImplementedException
which is convenient for creating stubs. Of course, in this particular case I could return true or false, but I want the solution that is applicable for any return type.
You want the unimplemented!
macro (doc link).
fn my_method() -> bool {
unimplemented!()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With