Private API
This page lists non-exported (internal) symbols of CTSolvers.Options.
From CTSolvers.Options
NotStored
CTSolvers.Options.NotStored — Constant
NotStoredInternal singleton instance of NotStoredType.
Used internally by the option extraction system to signal that an option should not be stored. This is distinct from nothing which is a valid option value.
See also: NotProvided, extract_option
NotStoredType
CTSolvers.Options.NotStoredType — Type
struct NotStoredTypeInternal sentinel type used by the option extraction system to signal that an option should not be stored in the instance.
This is returned by extract_option when an option has NotProvided as its default and was not provided by the user.
Note
This type is internal to the Options module and should not be used directly by users. Use NotProvided instead.
See also: NotProvided, extract_option
_construct_option_definition
CTSolvers.Options._construct_option_definition — Function
_construct_option_definition(
name::Symbol,
type::Type,
default::Nothing,
description::String,
aliases::Tuple{Vararg{Symbol}},
validator::Union{Nothing, Function},
computed::Bool
) -> CTSolvers.Options.OptionDefinition{Any}
Construct an OptionDefinition with a nothing default value.
This method handles the special case where default = nothing, creating an OptionDefinition{Any} with type = Any since nothing can represent any type.
Arguments
name::Symbol: Primary name of the optiontype::Type: Expected Julia type (ignored fornothingdefaults)default::Nothing: Must benothingdescription::String: Human-readable descriptionaliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)validator::Union{Function, Nothing}: Optional validation function (default:nothing)computed::Bool: Whether the default is computed from parameters (default:false)
Returns
OptionDefinition{Any}: Option definition withnothingdefault
Example
julia> using CTSolvers.Options
julia> def = _construct_option_definition(
:backend,
Union{Nothing, String},
nothing,
"Execution backend",
(:be,)
)
OptionDefinition{Any}(...)
julia> default(def)
nothingSee also: OptionDefinition, NotProvided
_construct_option_definition(
name::Symbol,
type::Type,
default::CTSolvers.Options.NotProvidedType,
description::String,
aliases::Tuple{Vararg{Symbol}},
validator::Union{Nothing, Function},
computed::Bool
) -> CTSolvers.Options.OptionDefinition{CTSolvers.Options.NotProvidedType}
Construct an OptionDefinition with a NotProvided default value.
This method handles the special case where default = NotProvided, creating an OptionDefinition{NotProvidedType}. The declared type is preserved since NotProvided indicates the absence of a default value while maintaining type information for validation.
Arguments
name::Symbol: Primary name of the optiontype::Type: Expected Julia type for user-provided valuesdefault::NotProvidedType: Must beNotProvideddescription::String: Human-readable descriptionaliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)validator::Union{Function, Nothing}: Optional validation function (default:nothing)computed::Bool: Whether the default is computed from parameters (default:false)
Returns
OptionDefinition{NotProvidedType}: Option definition with no default value
Example
julia> using CTSolvers.Options
julia> def = _construct_option_definition(
:input_file,
String,
NotProvided,
"Input file path",
(:input,)
)
OptionDefinition{NotProvidedType}(...)
julia> is_required(def)
trueSee also: OptionDefinition, NotProvided, is_required
_construct_option_definition(
name::Symbol,
type::Type,
default,
description::String,
aliases::Tuple{Vararg{Symbol}},
validator::Union{Nothing, Function},
computed::Bool
) -> CTSolvers.Options.OptionDefinition{Any}
Construct an OptionDefinition with a concrete default value.
This method handles the general case where default is a concrete value. It infers the type parameter T from the default value and validates that the default value is compatible with the declared type.
Arguments
name::Symbol: Primary name of the optiontype::Type: Expected Julia type for the option valuedefault::T: Default value (typeTis inferred)description::String: Human-readable descriptionaliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)validator::Union{Function, Nothing}: Optional validation function (default:nothing)computed::Bool: Whether the default is computed from parameters (default:false)
Returns
OptionDefinition{T}: Option definition with concrete default value
Throws
CTModels.Exceptions.IncorrectArgument: Ifdefaultis not compatible withtype
Example
julia> using CTSolvers.Options
julia> def = _construct_option_definition(
:max_iter,
Int,
100,
"Maximum number of iterations",
(:max,)
)
OptionDefinition{Int}(...)
julia> default(def)
100See also: OptionDefinition, Exceptions.IncorrectArgument