This may sound like a dumb question but what if you have, lets say a stock app, which a stock has multiple connections to other objects like:
Would it be to much to create a
none arc function
new & another
arc_new function to try and take advantage of
Arc::new to then use
Im saying this because I need the coupling of the user connected to all of those objects to pass the data across objects, & update the state or present the state, for that particular user across the objects that are connected to them. Handling all this manually has been a fun disaster but fun no matter figuring it out lol.
Its a confusing example but Im trying to wrap my ahead around
clone in terms of web development because I just completed my
Computer Science degree after 11 years at
40 yrs old & I want to try my hand at rust in the backend.
Maybe its a dead end. Idk and Idc. I love rust & finally am getting the time to dig into it deep.
If some one sees this post I would greatly apreciate any content on rust in the backend. I have no idea on how to use it for anything else.
Just for backend. I know i couldve called
Arc directly but im just figuring out new ways to implement things.
Also as you can see I am cloning in the
new function but im not sure if cloning at the call site would be a better idea or cloning on every object creation makes sense.
Im just trying to track the state as each connected objects state changes as the
user interacts in their account, buying stock and checking the status of the account in the app. Which then in theory since there is no concwpt of localstorage in
rust save those session in a file, for when the user logs in again they can still fetch that session from the last one and start right back up with the stocks that were purchase, balance and among other things. I do not want to use a database yet because I want to have a branch just doing things locally first to learn the language well. So fetching data
from a json file in the app for now and things of that nature. I feel this has helped me figuring out the lanaguage better, instead of jumping in to
actix not understanding why everything is
unwraped when you should handle that error with
unwrap_or_else, atleast that is what makes sense to me. what this does
? at the end of a function call, which is a
Result<SomeType, Error> that returns a
Long post. Just really going in circles but having incremental success. lol