-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
self mutable reference #4
Comments
I had intended implemetors of the crates to handle internal mutability. While in the BSD socket library, I can call Requiring a |
I think that makes sense. I will go with the internal mutability 👍 |
Cross linking to #39 |
I am a bit unsure on why this shouldn't have a mutable reference to self?
The way i see it, you would usually implement this on some sort of network client, owning access to a peripheral (unix fd, SPI, I2C, Serial etc.), but most (all?) of these require a mutable reference to be able to send data. This could be fixed by wrapping the peripheral in a
RefCell
, but even then there is a good chance that the client object would hold stuff like internal state etc that needs to be mutated, meaning that in my particular case, i would end up with a client object of 5 fields, all wrapped inRefCell
.Is this intended behavior, or am i implementing something wrong in general?
The text was updated successfully, but these errors were encountered: