pub fn depleted(
ctx: &Context,
req: DepletedRequest,
) -> Result<Outcome<Vec<PantryItem>>, CoreError>Expand description
The items that are low or out of stock, in file order.
An item is returned when PantryItem::is_low says so. When it does not,
the answer depends on what there is to go on:
- No quantity at all: only with
DepletedRequest::all, since there is nothing to compare. - A quantity, and a
lowthreshold in the same units:is_lowhas already compared them and said no, so only withDepletedRequest::all. - A quantity, and either no threshold or one in units that do not match:
the built-in thresholds decide — at or below 100 for
gandml, below 0.5 forkgandl, at or below 1 for anything else, including a bare count.
§Errors
As load.