First post on this forum, and first post at all in the Rust community, so empathize
I came from Java, and I am trying to do a clean architecture in Rust.
You could see what I have already done here : https://github.com/Azel-ytof/rust-clean-architecture-example
But the project do not compile !
Indeed, I think that in Interactor (the usecase) the OutpuMessage must take ownership of the UserEntity. And the presenter must take ownership of OutputMessage, so that ViewModel take ownership of UserEntity, wich is contained by OutputMessage and passed to the ViewModel in the Presenter sucess or error function.
It may be confusing like that, but if you take a loot at the Github repository, you may understand.
So finally, I found that I must implement 'Clone' on UserEntity, but next a lot of search, I have read that it is not a best practice.
I have read too that a '&str' in a struct is when the value could be change, and with a 'String', the goal is that the value not changed.
So, what are the best practices ? Keep String and put Clone ? Change to &str ? Keep String but don't give ownership, but just give references ?
Sorry for my english, I have tried to be clear as possible.
I can try to explain in other way if you don't understand what I tried to explain and ask