![]() The topic is too advanced for the book, but I wanted to provide an external source to reference for people who are curious. This allows Rhai to be integrated into an existing Rust code base with as little plumbing as possible, usually silently and seamlessly. The type can be anything it does not have any prerequisites other than being Clone.It does not need to implement any other trait or use any custom derive. Let me use some unsafe Rust to show you exactly whats happening at the machine level. clone doesnt have to give you the original value - String is one of the types where thats not true. ![]() Rhai works seamlessly with any Rust type. So I can clone a reference and I will get the original value as long as the struct is deriving Clone Am I right No. This is a topic that has intrigued me for a while, in particular because it demonstrates some fundamental differences in how Rust and Haskell approach mutability. Register any Rust Type and its Methods Free Typing. ![]() While reviewing the second-to-last chapter in the Begin Rust book, a slightly more advanced topic came up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |