MigrationFn

Type Alias MigrationFn 

Source
pub type MigrationFn<T, S> = fn(OpenFgaServiceClient<T>, Option<String>, Option<String>, S) -> BoxFuture<'static, Result<(), StdError>>;
Expand description

Possible function pointer that implements the migration function signature.

The arguments are:

  1. A client connected to endpoint that’s being migrated
  2. The id of the authorization model active prior to the invocation of the function
  3. The id of the authorization model active when the function is invoked
  4. The (user defined) state passed into the migration function

Authorization model ids may be undefined (None), e.g. for the pre hook of the first migration neither a previous nor a current model exist. For the first migration run by TupleModelManager::migrate, the previous model id is always None.