upsert_bond

Function upsert_bond 

Source
pub fn upsert_bond(
    bonds: &mut Vec<StoredBond, MAX_BONDS>,
    bond: StoredBond,
) -> BondUpsert
Expand description

Insert or refresh bond in bonds, which is kept ordered least-recently-used-first / most-recently-used-last (index 0 is the eviction candidate). A bond matching by address_kind + address is refreshed in place and moved to the MRU end; a new bond is appended at the MRU end, evicting the current LRU entry first if the list is full.