On Wed Oct 14, 2026 at 12:56 PM JST, Eliot Courtney wrote:
<...>
>> - /// Receive a message from the GSP.
>> + /// Wait for the next element on the message queue, pass it to
>> [`MessageElement::read`], and
>> + /// advances the read pointer past it.
>> ///
>> - /// A message whose function code is `M::FUNCTION` is decoded and
>> returned. Any other message
>> - /// is logged as an event.
>> - ///
>> - /// The read pointer is always advanced past the message, regardless of
>> whether it matched.
>> + /// The read pointer advances regardless of whether
>> [`MessageElement::read`] succeeds or not.
>> ///
>> /// # Errors
>> ///
>> - /// - `ETIMEDOUT` if `timeout` has elapsed before any message becomes
>> available.
>> - /// - `EIO` if there was some inconsistency (e.g. message shorter than
>> advertised) on the
>> - /// message queue.
>> - /// - `ENOMSG` if the message was not the awaited reply.
>> - ///
>> - /// Error codes returned by [`MessageFromGsp::read`] are propagated
>> as-is.
>> - fn receive_msg<M: MessageFromGsp>(&mut self, timeout: Delta) ->
>> Result<M>
>> - where
>> - // This allows all error types, including `Infallible`, to be used
>> for `M::InitError`.
>> - Error: From<M::InitError>,
>> - {
>> + /// Errors from [`Self::wait_for_msg`] and from
>> [`MessageElement::read`] are propagated
>> + /// as-is.
>> + fn consume_element<M: MessageElement>(&mut self, timeout: Delta) ->
>> Result<M> {
>
> Ok, so we are changing the semantics to this always consumes the element
> in a few more cases. I think this is ok and it's documented so sgtm. And
> maybe we do something for poisoning later?
Yes, John had a proper poisoning mechanism in the r000 series, but I
suggested we revisit that after the r000 conversion to simplify and
introduce a generic `Poisonable` container (or something in the same
fashion as `Mutex`) instead of using a `bool`. So that's definitely on
the radar.