Skip to main content

create

Function create 

Source
pub fn create(
    root: &AppRoot,
    adapter: &dyn Adapter,
    profile: &ProfileName,
) -> Result<(CreateOutcome, PathBuf)>
Expand description

Ensures the paths adapter owns for profile under root exactly once: an already materialized profile is left untouched, so a user’s hand-edited configuration file is never overwritten. The returned path is the first of the adapter’s paths, the profile directory; the function is the same kind of pure, outcome-returning function as config::link.

The outcome is decided from presence before anything is written, so it reads the state the user sees, not the state this call would leave behind.