Categories
Software Development

Simple Rust Mutation Relationship Diagram

Rust mutation can be somewhat confusing if your a beginner. Its similar to C++ way of doing things on where to put the asterisk (*) and ampersand (&) sign in variable declaration. Moving the asterisk sign and ampersand sign makes the declaration sometimes more mutable and also can make it less mutable.

Here is a simple diagram on Rust mutation that I found on StackOverflow (SO). I can’t find the exact link to reference as this one is stored in my notes.


        a: &T == const T* const a;      // can't mutate either
    mut a: &T == const T* a;            // can't mutate what is pointed to
    a: &mut T == T* const a;            // can't mutate pointer
mut a: &mut T == T* a;                  // can mutate both

By Edward Fitz Abucay

"How long is forever?"

I'm a software engineer with a passion for innovating and creating products, especially for startups in the web3 and blockchain space. I'm always excited to learn and work with new technologies, and I'm committed to delivering high-quality solutions that meet the needs of my clients or users.

In my free time, I enjoy listening to music of all genres, but classical music holds a special place in my heart. I find it both inspiring and calming, and it helps me to stay focused and creative. I'm also an avid reader of books and manga, and I enjoy discovering new authors and stories.

As a software engineer, I have a strong technical background with experience in various programming languages, frameworks, and tools. I'm always striving to improve my skills and stay up-to-date with the latest trends and best practices. I love working with startups, especially those in the web3 and blockchain space, because I believe that these technologies have the potential to revolutionize the way we live and work.

Overall, I'm a dedicated and driven individual with a wide range of interests and skills. I believe that my passion for software engineering, combined with my love of music and reading, makes me a well-rounded and adaptable professional.

Leave a Reply

Your email address will not be published. Required fields are marked *