pub struct Options<'a> {
    pub max_depth: u8,
    pub err_on_max_depth_exceeded: bool,
    pub err_on_interpolation_failure: bool,
    pub err_on_missing_config_path: bool,
    pub interpolate: Context<'a>,
    pub conditional: Context<'a>,
}
Expand description

Options to handle includes, like include.path or includeIf.<condition>.path,

Fields

max_depth: u8

The maximum allowed length of the file include chain built by following nested resolve_includes where base level is depth = 0.

err_on_max_depth_exceeded: bool

When max depth is exceeded while following nested includes, return an error if true or silently stop following resolve_includes.

Setting this value to false allows to read configuration with cycles, which otherwise always results in an error.

err_on_interpolation_failure: bool

If true, default false, failing to interpolate paths will result in an error.

Interpolation also happens if paths in conditional includes can’t be interpolated.

err_on_missing_config_path: bool

If true, default true, configuration not originating from a path will cause errors when trying to resolve relative include paths (which would require the including configuration’s path).

interpolate: Context<'a>

Used during path interpolation, both for include paths before trying to read the file, and for paths used in conditional gitdir includes.

conditional: Context<'a>

Additional context for conditional includes to work.

Implementations

Provide options to never follow include directives at all.

Provide options to follow includes like git does, provided the required conditional and interpolate contexts to support gitdir and onbranch based includeIf directives as well as standard include.path resolution. Note that the follow-mode is git-style, following at most 10 indirections while producing an error if the depth is exceeded.

For use with follow type options, cause failure if an include path couldn’t be interpolated or the depth limit is exceeded.

Like follow, but without information to resolve includeIf directories as well as default configuration to allow resolving ~username/ path. home_dir is required to resolve ~/ paths if set. Note that %(prefix) paths cannot be interpolated with this configuration, use follow() instead for complete control.

Set the context used for interpolation when interpolating paths to include as well as the paths in gitdir conditional includes.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

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

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. 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.