pub struct MarketLoad { /* private fields */ }Expand description
Loads and screens one market at each update, for a router.
Make a new load at each update, with the mints just read. Fetch what
missing names, insert each account
that the fetch gives, and call missing again. When it is empty, call
finish. missing names each account once. Insert
nothing for an account that the router cannot fetch: a direction that
reads it does not route.
Declare LoadedMarket::declare for the next update. A router that
serves only declared accounts then loads one more link of a chain of reads
at each update.
Implementations§
Source§impl MarketLoad
impl MarketLoad
pub fn new(args: MarketLoadArgs) -> Self
Sourcepub fn missing(&mut self) -> Result<Vec<Address>, HookError>
pub fn missing(&mut self) -> Result<Vec<Address>, HookError>
The accounts to fetch next: what MintInfo::missing names for each
mint, and what the screens lack. It leaves out each account that it
named before. Empty when the load can learn nothing more.
§Errors
The error of MintInfo::missing.
Sourcepub fn insert(&mut self, address: Address, account: Option<FetchedAccount>)
pub fn insert(&mut self, address: Address, account: Option<FetchedAccount>)
Records what a fetch of address gave: None for no account. A mint
whose MintInfo::missing names it also holds it.