Exchange cannot be measured or emptied #9

Closed
opened 2026-08-14 21:13:03 +00:00 by rosa · 0 comments
Owner

Exchange offers no way to ask how many quotes it holds, whether it holds any,
or to withdraw one. MoneyBag has is_empty and len (src/bag.rs:166,
src/bag.rs:187); Exchange has neither, so the only way to count is
quotes().count().

There is also no remove and no clear. A table that fills from a live feed can
only grow — a quote that goes stale, or a currency pair that stops trading, stays
in the table for the lifetime of the value.

Add at minimum len and is_empty; consider remove and clear alongside
them.

`Exchange` offers no way to ask how many quotes it holds, whether it holds any, or to withdraw one. `MoneyBag` has `is_empty` and `len` (`src/bag.rs:166`, `src/bag.rs:187`); `Exchange` has neither, so the only way to count is `quotes().count()`. There is also no `remove` and no `clear`. A table that fills from a live feed can only grow — a quote that goes stale, or a currency pair that stops trading, stays in the table for the lifetime of the value. Add at minimum `len` and `is_empty`; consider `remove` and `clear` alongside them.
rosa closed this issue 2026-08-14 22:06:15 +00:00
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/lucre#9
No description provided.