source
ModuleWhere resources come from.
Contents
use utopia_migration::source::Emitter;pub struct Emitter<'a>Hands a source's exported batches to the run's sink: resources of types that were not requested are marked skipped, and the rest (except rows and documents, which the destination counts) are cached after the sink took the batch.
use utopia_migration::source::Sink;pub trait Sink: SendReceives batches of exported resources (the destination's import).
use utopia_migration::Source;pub trait Source: crate::target::AsAny + SendA service resources are exported from.
A source exports in groups (crate::transfer::group): each group it
supports in Source::export_group, emitting batches through the
Emitter. Errors of a group are usually collected
(Target::add_error) rather than returned, so the transfer goes on.
use utopia_migration::source::export_resources;pub async fn export_resources<S: Source + ?Sized>(source: &mut S, resources: &[String], out: &mut Emitter<'_>) -> Result<()>The default Source::export_resources.
use utopia_migration::source::requested;pub fn requested(types: &[&str], resources: &[String]) -> boolWhether any of types is requested in resources (with legacy names).
use utopia_migration::source::run;pub async fn run<S: Source + ?Sized>(source: &mut S, resources: &[String], sink: &mut dyn Sink, root_resource_id: &str, root_resource_type: &str) -> Result<()>The default [Source::run]: sets the root resource for the run (and
restores the previous one after), and exports through an Emitter.
pub type ResourceIds = IndexMap<String, Value>Resource ids of a report, by root resource type.