jannic[m] has quit [Quit: Idle timeout reached: 172800s]
mkj[m] has quit [Quit: Idle timeout reached: 172800s]
Ralph[m] has joined #rust-embedded
<Ralph[m]>
James Munns: I'm not sure if you've seen it, but I have a bunch of PRs open on the `postcard-rpc` repo. do you have a rough ETA for a new release? IIRC i also briefly tried using it with the git version of `embassy-usb` and noticed that it isn't compatible with that => it might be great to get a new `embassy-usb` release out (presuming that the API there is now "stable"-ish (not sure what's planned there?) beforehand and add support
<Ralph[m]>
for that new release?
<Ralph[m]>
btw: so far, using `postcard-rpc` is really nice and easy!
<Ralph[m]>
the only thing i encountered has nothing to do with you: RustRover (my IDE) stumbles over the macro and thus incorrectly highlights it as wrong (and fails to offer some things in auto-complete). i've reported it to them and hope that they'll fix it in the next release:
<KevinPFleming[m]>
The intent here is to return a MutexGuard derived from a Mutex in a StaticCell, so the MutexGuard itself does not have static lifetime.
wassasin[m] has joined #rust-embedded
<wassasin[m]>
Kevin P. Fleming: the guard is owned (so it has no lifetime), but it *refers* to a static lifetime
<wassasin[m]>
So changing the function prototype to `pub async fn stream(&self) -> Stream<'static> {` should work
<wassasin[m]>
If you want to tie up `Handle` you can add the lifetime of `&self` to it using PhantomData
<KevinPFleming[m]>
ahh!
<wassasin[m]>
Or just a reference to &self/Handle I guess
<KevinPFleming[m]>
I don't need to tie up the Handle, there are many of them and they are all useful at the same time, since there is a Mutex inside the Handle
<KevinPFleming[m]>
thanks for the explanation.
<wassasin[m]>
I guess you can also remove the lifetime parameter from Stream then and use `guard: mutex::MutexGuard<'static, ThreadModeRawMutex, crc::Crc<'static>>,` instead
<wassasin[m]>
You say there are many handles, but the new function implies that only a single one exist because a second new will panic
<wassasin[m]>
You mean you pass a non-mutable reference around?
<KevinPFleming[m]>
yes, the Handle struct is Copy/Clone
<wassasin[m]>
Ah right
<Emkanea[m]>
I got the following situation: I have a small external EEPROM (128 Bytes) connected via I2C. I want to store some data there. In C I would make a packed structure and use this as my serialization via pointers ( (uint8_t*)&my_struct ). What is the idomatic rust way to get a minimum overhead binary representation? Something better than equivalent to C: repr(C) + transmute ?
<wassasin[m]>
Emkanea: if it fits Postcard is nice