Skip to main content

restore_from_code

Function restore_from_code 

Source
pub async fn restore_from_code(
    builder: CovenBuilder,
    code: &str,
    s3_credentials: Option<S3Credentials>,
    device_name: &str,
    on_status: impl Fn(BootstrapStatus),
    cancel: &Receiver<bool>,
) -> Result<CovenHandle, BootstrapError>
Expand description

Restore this person’s store on a new device, returning its open handle. S3 requires a key: the one the code carries, or one entered separately, never both. Other providers require None and use the builder’s own sign-in. Invalid key inputs fail before bootstrap begins. A store whose unfinished installation holds a join’s saved code is refused with StoreLockError::BootstrapPending before anything changes (§13.4). Until the restore records itself, a cancel or a failure removes the installation it loaded into (§13.1).