pub struct Routes<DB: HasJars> { /* private fields */ }
Expand description

The “routes” structure is used to navigate the database. The database contains a number of jars, and each jar contains a number of ingredients. When the database is created, it creates each jar in turn. Each jar then creates its ingredients. Each ingredient is registered with the database by invoking the Routes::push method. This method assigns it a unique IngredientIndex and stores some callbacks indicating how to find the ingredient later based only on the index.

Implementations

Adds a new ingredient into the ingredients table, returning the IngredientIndex that can be used in a DatabaseKeyIndex. This index can then be used to fetch the “route” so that we can dispatch calls to maybe_changed_after.

Parameters
  • requires_reset – if true, the Ingredient::reset_for_new_revision method will be called on this ingredient at each new revision. See that method for more information.
  • route – a closure which, given a database, will identify the ingredient. This closure will be invoked to dispatch calls to maybe_changed_after.
  • mut_route – a closure which identifies the ingredient in a mut database.

Given an ingredient index, return the “route” (a function that, given a &Jars, returns the ingredient).

Given an ingredient index, return the “mut route” (a function that, given an &mut Jars, returns the ingredient).

Returns the mut routes for ingredients that need to be reset at the start of each revision.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.