Skip to main content

prefetch

Function prefetch 

Source
pub async fn prefetch(pool: &Pool) -> Vec<MenuRow>
Expand description

Fetch every published page with show_in_menus = true, project to MenuRow, and return the pool. Bounded by the tenant’s menu-eligible cardinality (typically tens; a large site a few hundred). Failures degrade to an empty pool — the menu just renders empty rather than 500’ing the page.

Built-in Error pages (404/500 …) are excluded regardless of their show_in_menus flag — they’re failure substitutes, not navigation destinations, and a root-level error page would otherwise duplicate the host chrome’s per-root nav blocks (same rationale as the sitemap exclusion).

§Errors

None — driver / query failures are logged and yield an empty pool.