Free function to trait impl
reddit.com·13w·
Discuss: r/rust

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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help