ReplStartupBuilder
Declares preparation configuration, frozen on the first preparation.
- Kind:
Class - Namespace: Repl
- Assembly:
Repl.Core - Source: src/Repl.Core/Startup/ReplStartupBuilder.cs
Signature
Section titled “Signature”public sealed class ReplStartupBuilderInheritance
Section titled “Inheritance”Methods
Section titled “Methods”Options(Action<ReplOptions>)
Section titled “Options(Action<ReplOptions>)”Configures options used for preparation and imported into created applications.
public ReplStartupBuilder Options(Action<ReplOptions> configure)Parameters
Section titled “Parameters”configure(Action<ReplOptions>): Configuration callback; it must be safe to apply to independent applications.
Returns
Section titled “Returns”ReplStartupBuilder - The builder.
PrepareAsync(string[], CancellationToken)
Section titled “PrepareAsync(string[], CancellationToken)”Normalizes and prepares an independent invocation without constructing application services.
public ValueTask<PreparedReplStartup> PrepareAsync(string[] args, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”args(string[]): Original arguments.cancellationToken(CancellationToken): Caller cancellation.
Returns
Section titled “Returns”ValueTask<PreparedReplStartup> - A snapshot or a terminal result usable before application construction.
UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>)
Section titled “UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>)”Adds an argument adapter that also transfers to the application’s interactive pipeline.
public ReplStartupBuilder UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult> adapter)Parameters
Section titled “Parameters”adapter(Func<ArgumentPreprocessingContext, CancellationToken, ArgumentPreprocessingResult>): Argument adapter.
Returns
Section titled “Returns”ReplStartupBuilder - The builder.
UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>)
Section titled “UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>)”Adds an argument adapter that also transfers to the application’s interactive pipeline.
public ReplStartupBuilder UseArgumentPreprocessor(Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>> adapter)Parameters
Section titled “Parameters”adapter(Func<ArgumentPreprocessingContext, CancellationToken, ValueTask<ArgumentPreprocessingResult>>): Argument adapter.
Returns
Section titled “Returns”ReplStartupBuilder - The builder.
UseGlobalOptions<T>()
Section titled “UseGlobalOptions<T>()”Declares a typed global option group once for preparation and execution.
public ReplStartupBuilder UseGlobalOptions<T>() where T : class, new()Type Parameters
Section titled “Type Parameters”T: Options type.
Returns
Section titled “Returns”ReplStartupBuilder - The builder.
UsePreparationHook(Delegate)
Section titled “UsePreparationHook(Delegate)”Adds an ordered preparation hook. Application services are not available here.
public ReplStartupBuilder UsePreparationHook(Delegate hook)Parameters
Section titled “Parameters”hook(Delegate): Hook returning an argument decision, synchronously or asynchronously.
Returns
Section titled “Returns”ReplStartupBuilder - The builder.