
mikecargal
Hands-On Rust: Explain Read<xxx> introduced at end of chapter 7
Title: Hands-On Rust (End of chapter 7)
the query to acquire movers is changed to add Entity (that seems obvious), but point was changed from &mut Point
to Read<Point>
. ( I understand it’s not necessary to be mutable anymore), and &MovingRandomly
is changed to Read<MovingRandomly>
.
I don’t recall seeing the Read<xxx>
stuff before and think it could use elaboration here.
Marked As Solved

herbert
Yes, please. Prior to version 0.3, Legion used a rather wordy syntax that required you to mark every component as Read<MyComponent>
or Write<MyComponent>
. I’m VERY glad they made it easier to use - but it changed mid-way through the book so everything got updated to the new syntax - or should have done. I’ll do another pass searching for that one.
Also Liked

mikecargal
So, both should just use &
then?
(Sorry, realized I could answer my own question, and, yep &'s work)
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /django
- /spring
- /diversity
- /nodejs
- /lua
- /slackware
- /julia
- /c
- /neovim