Free function to trait impl
reddit.com·12h·
Discuss: r/rust
Flag this post

Go to rust

r/rust

A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.


Members

Free function to trait impl

🙋 seeking help & advice

I have a trait that features 1 single function, let’s call it foo. This function cannot have a self parameter for a specific reason. Now I want types that implement the trait I can create unit structs and implement the trait for it. But this creates much boilerplate for just saying this implementation function is an implementation of this trait. If I could somehow get rid…

Similar Posts

Loading similar posts...