Currently the mailbox which a message is inserted into by transmit and transmit_preserve is not exposed to users. This feels like a design oversight as the mailbox is passed to the transmit_preserve callback.
Access to this value is useful as it can allow for additional metadata to be stored about pending frames which wouldn't fit inside the existing marker field (using an array indexed by Mailbox). For example a time to live value to determine whether a frame evicted by transmit_preserve should be placed back into a software queue or discarded.
This can be solved by modifying the return types of transmit and transmit_preserve to nb::Result<(Mailbox, Option<()>), Infallible> and nb::Result<(Mailbox, Option<P>), Infallible> respectively. As this would be a breaking change, I am seeking comments on whether or not these should be implemented as new separate functions instead before I proceed to implementing this change.
Currently the mailbox which a message is inserted into by
transmitandtransmit_preserveis not exposed to users. This feels like a design oversight as the mailbox is passed to thetransmit_preservecallback.Access to this value is useful as it can allow for additional metadata to be stored about pending frames which wouldn't fit inside the existing marker field (using an array indexed by
Mailbox). For example a time to live value to determine whether a frame evicted bytransmit_preserveshould be placed back into a software queue or discarded.This can be solved by modifying the return types of
transmitandtransmit_preservetonb::Result<(Mailbox, Option<()>), Infallible>andnb::Result<(Mailbox, Option<P>), Infallible>respectively. As this would be a breaking change, I am seeking comments on whether or not these should be implemented as new separate functions instead before I proceed to implementing this change.