Skip to content

ABI types

These are the types that cross the interface, and they are the same declarations a C program sees: c/fznso_types.h is generated from this crate by cbindgen, so FznsoModelMethods here and FznsoModelMethods in the header are one thing described once.

Read Types & values for what they mean, and Lifetimes & ownership for the rules that govern all of them.

33 types

struct FznsoAnnotationsource

The handle of an annotation on a decision, constraint or objective.

Opaque: only the side that created it may interpret it. Read it through FznsoAnnotationRef, which pairs it with the callbacks that can.

struct FznsoAnnotationMethodssource

The callbacks that read a FznsoAnnotation.

fieldident: extern "C" fn(ann: FznsoPtr<'_, FznsoAnnotation>) -> FznsoStr<'_>

Retrieve the identifier of an annotation.

The returned string can be assumed to have the same lifetime as the annotation reference and must be valid UTF8.

fieldargument_len: extern "C" fn(ann: FznsoPtr<'_, FznsoAnnotation>) -> usize

Retrieve the number of arguments of an annotation.

fieldargument: extern "C" fn(ann: FznsoPtr<'_, FznsoAnnotation>, index: usize) -> FznsoValueRef<'_>

Retrieve the value of the annotation’s argument at the given index.

The index argument must be less than the value returned by annotation_argument_len for the given annotation.

struct FznsoAnnotationRef<'a>source

An annotation together with the callbacks that read it.

fielddata: FznsoPtr<'a, FznsoAnnotation>

The data pointer of the annotation.

fieldmethods: &'static FznsoAnnotationMethods

Reference to the structure containing the function callbacks used to interact with the annotation.

methodfn argument(&self, index: usize) -> FznsoValueRef<'a>

The index-th argument of this annotation.

methodfn argument_len(&self) -> usize

Number of arguments this annotation carries.

methodfn arguments(&self) -> impl Iterator + 'a

Iterator over all arguments of this annotation.

methodfn ident(&self) -> &'a str

The annotation’s identifier string (e.g. "output_var").

struct FznsoConstraintIdxsource

Wrapper type for the indexes that represent constraints in the model.

struct FznsoConstraintList<'a>source

A list of FznsoConstraintTypes.

This type is for example used to return from fznso_<name>_constraint_list.

fieldlen: usize

The number of elements in the constraints array.

fieldconstraints: *const FznsoConstraintType<'a>

An array of constraint types.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime for which the constraints attribute is allocated.

methodconst fn empty() -> Self

Returns an empty list with no constraint types.

struct FznsoConstraintType<'a>source

Representation of a type of constraint, discerned by its identifier and the types of its arguments.

fieldident: FznsoStr<'a>

The identifier of the constraint type.

fieldarg_len: usize

The number of expected arguments for the constraint type.

fieldarg_types: *const FznsoType

The types of the expected arguments for the constraint type.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime for which the ident and arg_types attributes are allocated.

struct FznsoDecisionIdxsource

Wrapper type for the indexes that represent decision variables in the model.

struct FznsoFloatRangesource

An inclusive [min, max] float range, returned by FznsoValueMethods::get_range_float.

fieldmin: f64

The inclusive lower bound.

fieldmax: f64

The inclusive upper bound.

struct FznsoIntRangesource

An inclusive [min, max] integer range, returned by FznsoValueMethods::get_range_int.

fieldmin: i64

The inclusive lower bound.

fieldmax: i64

The inclusive upper bound.

struct FznsoModelsource

The handle of a model instance.

Opaque: only the side that created it may interpret it. Read it through FznsoModelRef, which pairs it with the callbacks that can.

struct FznsoModelMethodssource

The callbacks that read a FznsoModel.

Every index argument has a matching length callback, and must be below it. Everything these return (e.g. values, strings, and annotations) borrows from the model, and so is valid for as long as the model handle itself.

fieldlayer_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Returns the current number of model layers currently contained in the model.

Layers are how an application adds and retracts groups of decision variables and constraints between runs; see Self::layer_permanent for the ones that can never be retracted.

fieldlayer_unchanged: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Returns the number of layers that have been unchanged since the last call to fznso_<name>_solver_run.

Unchanged layers must be consecutive starting from layer 0.

fieldlayer_permanent: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Returns the number of permanent layers in the model.

Permanent layers are consecutive, starting from layer 0, and can never be retracted, so a solver may assume their number only ever grows.

Permanent layers can, however, still be found to be redundant, allowing the solver to remove the decision variables and constraints in these layers, if convenient. This is signaled using Self::layer_redundant_len and Self::layer_redundant_index.

fieldlayer_redundant_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Returns the number of permanent layers that have been marked as redundant.

The solver can remove the decision variables and constraints in these layers, if convenient. Once a layer is marked as redundant, it can forever be considered redundant. As such, the solver can assume that the number of redundant layers only ever increases.

fieldlayer_redundant_index: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, n: usize) -> usize

Returns the index of the n-th permanent layer that has been marked as redundant.

The n argument must be less than the value returned by Self::layer_redundant_len.

fielddecision_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Retrieve the number of decisions currently contained in the model.

fielddecision_layer_end: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, layer: usize) -> usize

Retrieve the exclusive upper bound on the decision indexes belonging to layers 0..=layer.

Layer layer therefore owns the decisions decision_layer_end(layer-1)..decision_layer_end(layer), taking the bound below layer 0 to be 0. It equals decision_layer_end(layer-1) when the layer adds no decisions, and Self::decision_len for the last layer.

fielddecision_type: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> FznsoType

Retrieve the type of the given decision variable.

This is what the type of value the decision must take, as opposed to Self::decision_domain, which says which specific values it may take.

fielddecision_domain: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> FznsoValueRef<'_>

Retrieve the domain of the given decision.

Note that the value might have FznsoValueKind::FznsoValueAbsent if the decision variable does not have an explicit domain.

fielddecision_name: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> FznsoStr<'_>

Retrieve the name of a decision variable, if it exists.

Note that names are only available for debugging purposes. Decisions are identified using their index in the model. If the decision variable does not have a name, the returned string has a null ptr.

fielddecision_defined: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> bool

Check whether the decision variable is defined by a constraint.

fielddecision_in_solution: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> bool

Check whether the application may ask a solution for this decision variable’s value.

A solver must give every such variable a value in every solution it reports, and is free to leave the others open.

fielddecision_annotation_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx) -> usize

Retrieve the number of annotations on a decision variable.

fielddecision_annotation: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, decision: FznsoDecisionIdx, index: usize) -> FznsoAnnotationRef<'_>

Retrieve the annotation on a decision variable at the given index.

Requires index to be less than Self::decision_annotation_len for that decision variable.

fieldconstraint_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Retrieve the number of constraints currently contained in the model.

fieldconstraint_layer_end: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, layer: usize) -> usize

Retrieve the exclusive upper bound on the constraint indexes belonging to layers 0..=layer.

Layer layer therefore owns the constraints constraint_layer_end(layer-1)..constraint_layer_end(layer), taking the bound below layer 0 to be 0. It equals constraint_layer_end(layer-1) when the layer adds no constraints, and Self::constraint_len for the last layer.

fieldconstraint_ident: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx) -> FznsoStr<'_>

Retrieve the identifier of a constraint.

The returned string can be assumed to have the same lifetime as the model reference and must be valid UTF8.

fieldconstraint_argument_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx) -> usize

Retrieve the number of arguments of a constraint.

fieldconstraint_argument: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx, index: usize) -> FznsoValueRef<'_>

Retrieve the value of the constraint’s argument at the given index.

The index argument must be less than the value returned by constraint_argument_len for the given constraint.

fieldconstraint_defines: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx) -> FznsoValueRef<'_>

Check whether the decision variable is functionally defined by a constraint.

This function returns a FznsoValue that is either FznsoValueKind::FznsoValueDecision if it defined a decision variable or FznsoValueKind::FznsoValueAbsent otherwise.

fieldconstraint_annotation_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx) -> usize

Retrieve the number of annotations on a constraint.

fieldconstraint_annotation: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, constraint: FznsoConstraintIdx, index: usize) -> FznsoAnnotationRef<'_>

Retrieve the annotation on a constraint at the given index.

The index argument must be less than the value returned by constraint_annotation_len for the given constraint.

fieldobjective_ident: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> FznsoStr<'_>

Request the identifier of the type of objective strategy to be used when solving the model.

Note that the returned string has a null ptr if the model does not have an objective strategy.

fieldobjective_arg: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> FznsoValueRef<'_>

Retrieve the argument of the objective strategy.

fieldobjective_annotation_len: extern "C" fn(model: FznsoPtr<'_, FznsoModel>) -> usize

Retrieve the number of annotations on an objective

fieldobjective_annotation: extern "C" fn(model: FznsoPtr<'_, FznsoModel>, index: usize) -> FznsoAnnotationRef<'_>

Retrieve the annotation on the objective at the given index.

The index argument must be less than the value returned by objective_annotation_len.

struct FznsoModelRef<'a>source

A model together with the callbacks that read it.

fielddata: FznsoPtr<'a, FznsoModel>

The handle to the data of the model instance.

fieldmethods: &'static FznsoModelMethods

Reference to the structure containing the function callbacks used to interact with the model.

struct FznsoObjective<'a>source

Representation of a type of objective strategies, discerned by its identifier and the type of its argument.

fieldident: FznsoStr<'a>

The identifier of the objective type.

fieldarg_type: FznsoType

The type of the expected argument for the constraint type.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime for which the ident attribute is allocated.

struct FznsoObjectiveList<'a>source

A list of FznsoObjectives.

This type is, for example, used to return from fznso_<name>_objective_list.

fieldlen: usize

The number of elements in the objectives array.

fieldobjectives: *const FznsoObjective<'a>

An array of objective strategies.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime of the options attribute.

methodconst fn empty() -> Self

Returns an empty list with no objective types.

struct FznsoOption<'a>source

The definition of an option that is available to be set for the solver.

fieldident: FznsoStr<'a>

The identifier used to set the option or get the current value of the option.

fieldarg_ty: FznsoType

The type of value that is expected for this option.

fieldarg_def: FznsoValueRef<'a>

The default value for this option.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime of the ident and arg_def attributes.

struct FznsoOptionList<'a>source

A list of FznsoOptions.

This type is, for example, used to return from fznso_<name>_option_list.

fieldlen: usize

The number of elements in the options array.

fieldoptions: *const FznsoOption<'a>

An array of option definitions.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime of the options attribute.

methodconst fn empty() -> Self

Returns an empty list with no options.

struct FznsoPtr<'a, T>source

A pointer to an FZnSO handle, tagged with the lifetime for which the handle stays valid.

This is deliberately a raw pointer rather than a Rust reference, because the interface relies on two things a reference cannot do:

  • Casting back to the implementation’s own type. A handle is produced by casting e.g. *const MyModel to *const FznsoModel, and the callbacks cast it back before use. A &FznsoModel would only carry permission to access the opaque handle type itself, so reading the larger original type through it is undefined behaviour.
  • Encoding a value directly in the pointer word. Small values such as a FznsoDecisionIdx are stored in the pointer rather than behind it, so that handing one across the interface never requires an allocation. See FznsoPtr::from_addr.

The 'a lifetime costs nothing at runtime. It exists so that callback signatures state how long the handle — and anything derived from it — remains valid, which is what lets the return types of FznsoModelMethods and friends borrow from their argument.

cbindgen:no-export

fieldptr: *const T

The pointer to the handle, or a value encoded in the pointer word.

fieldlifetime: std::marker::PhantomData<&'a T>

The lifetime for which ptr stays valid.

methodfn addr(self) -> usize

Read back a payload stored with FznsoPtr::from_addr.

methodconst fn cast<U>(self) -> *const U

Reinterpret this handle as a pointer to U.

This is the inverse of FznsoPtr::from_ref. Dereferencing the result is only sound if U is the type the handle was originally built from.

methodconst fn from_addr(addr: usize) -> Self

Store a plain integer payload directly in the pointer word.

The result carries no provenance and must never be dereferenced; only FznsoPtr::addr may read it back. This is how small values cross the interface without an allocation.

methodconst fn from_ref<S>(value: &'a S) -> Self

Wrap a reference to the implementation’s own type as an opaque handle.

The handle keeps permission to access the whole of S, so the callbacks may cast it back with FznsoPtr::cast.

methodconst fn new(ptr: *const T) -> Self

Wrap a raw pointer that already points at the handle’s contents.

struct FznsoSolutionsource

The handle of a solution reported by a solver.

Opaque: only the side that created it may interpret it. Read it through FznsoSolutionRef, which pairs it with the callbacks that can.

struct FznsoSolutionMethodssource

The callbacks that read a FznsoSolution.

The values these return borrow from the solution, so they last only as long as it does (i.e. for the duration of the on_solution callback that delivered it). Copy out anything that has to outlive the call.

fieldvalue: extern "C" fn(data: FznsoPtr<'_, FznsoSolution>, decision_index: usize) -> FznsoValueRef<'_>

Function callback to retrieve the value assigned to a decision variable in the solution.

fieldstatistic: extern "C" fn(data: FznsoPtr<'a, FznsoSolution>, ident: FznsoStr<'i>) -> FznsoValueRef<'a>

Function callback to retrieve the statistical information made available by the solver about the search process so far.

struct FznsoSolutionRef<'a>source

A solution together with the callbacks that read it.

fielddata: FznsoPtr<'a, FznsoSolution>

The data pointer to be used as the first argument in the function callbacks provided by the methods field.

fieldmethods: &'static FznsoSolutionMethods

Reference to the structure containing the function callbacks used to interact with the solution.

struct FznsoSolversource

The handle of a solver instance, as returned by fznso_solver_create.

Opaque: only the solver library may interpret it. An application passes it back to the library’s entry points and releases it with fznso_solver_free.

struct FznsoStatistic<'a>source

The definition of statistical information that is made available by the solver.

The solution and solver flags say where the statistic can be read from, and are independent: a statistic may be available from a solution, from the solver instance, or from both. At least one of them must be set — a statistic with neither could be read from nowhere.

fieldident: FznsoStr<'a>

The identifier used to retrieve the statistical information from the solver or a solution.

fieldty: FznsoType

The type of value that is expected for this statistic.

fieldsolution: bool

Whether the statistic is available from a solution, read with FznsoSolutionMethods::statistic.

fieldsolver: bool

Whether the statistic is available from the solver instance, read with fznso_solver_statistic.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime of the ident attribute.

struct FznsoStatisticList<'a>source

A list of FznsoStatistics.

This type is, for example, used to return from fznso_<name>_statistic_list.

fieldlen: usize

The number of elements in the stats array.

fieldstats: *const FznsoStatistic<'a>

An array of statistic definitions.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime of the stats attribute.

methodconst fn empty() -> Self

Returns an empty list with no statistics.

struct FznsoStr<'a>source

A borrowed UTF-8 string, passed across the interface as a pointer/length pair.

The bytes are not required to be null-terminated; consumers must use len to determine the string extent. This matches the convention used by FznsoValueMethods::as_string, and allows implementations to hand out slices of strings they already hold without copying them into a null-terminated buffer.

A null ptr signals the absence of a string, which is used where a name or identifier is optional (e.g. FznsoModelMethods::decision_name).

fieldptr: *const ffi::c_char

Pointer to the first UTF-8 byte of the string, or null if absent.

fieldlen: usize

The number of bytes in the string, not counting any trailing null byte.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime for which ptr stays valid.

methodunsafe fn as_str(self) -> Option<&'a str>

Interpret this string as a &str, or None if ptr is null.

ptr must point to len bytes of valid UTF-8 that stay live for 'a.

methodconst fn new(value: &'a str) -> Self

Borrow a &str as an interface string.

Usable in const context, so that the capability lists a solver declares — which are static — can name their identifiers directly.

struct FznsoTypesource

Representation of a type to signal and check whether an argument takes the correct type.

fieldlist_of: bool

Whether the type is a list of values.

fielddecision: bool

Whether the argument can be or contain decision variables (represented as decision indexes).

fieldset_of: bool

Whether expected type is an set of values of the base type.

fieldopt: bool

Whether the expected type is optional (and can take the value of FznsoValueKind::FznsoValueAbsent).

fieldbase: FznsoTypeBase

The expected base type of the argument.

methodconst fn decision(self, decision: bool) -> Self

Whether this type is a decision variable rather than a parameter.

methodconst fn list(self, list_of: bool) -> Self

Whether this type is a list of its element type.

methodconst fn new(base: FznsoTypeBase) -> Self

A plain parameter type of the given base: not a list, not a set, not a decision variable and not optional.

Each qualifier is a builder method taking the value to give it, so a type only ever carries the flags it was actually told about, and a flag that depends on something can be passed straight through:

# use fznso_types::{FznsoType, FznsoTypeBase};
// `list of var int`
let arg = FznsoType::new(FznsoTypeBase::FznsoTypeBaseInt)
.list(true)
.decision(true);
// `var set of int`, or plain `var int`, depending on `of_sets`
let of_sets = true;
let var = FznsoType::new(FznsoTypeBase::FznsoTypeBaseInt)
.decision(true)
.set(of_sets);
methodconst fn opt(self, opt: bool) -> Self

Whether this type also permits the absent value.

methodconst fn set(self, set_of: bool) -> Self

Whether this type is over sets of its base type rather than single values.

struct FznsoTypeList<'a>source

A list of FznsoTypes.

This type is for example used to return from fznso_<name>_decision_list.

fieldlen: usize

The number of elements in the types array.

fieldtypes: *const FznsoType

An array of decision-variable types.

fieldlifetime: std::marker::PhantomData<&'a ()>

The lifetime for which the types attribute is allocated.

methodconst fn empty() -> Self

Returns an empty list with no decision types.

struct FznsoValuesource

The handle of a value: a constraint argument, a variable domain, a solution assignment, an option or a statistic.

Opaque: only the side that created it may interpret it. Read it through FznsoValueRef, which pairs it with the callbacks that can.

This is the handle least likely to be a pointer at all: a small payload such as a decision index is normally stored in the pointer word rather than behind it, and the absent value carries a null. Dispatch on FznsoValueMethods::kind and use the accessor it permits; never dereference the handle itself.

struct FznsoValueMethodssource

The callbacks that read a FznsoValue.

FznsoValueMethods::kind decides which of the others are meaningful; each states the precondition it needs. A nested value or string that these return borrows from the value it came from.

fieldkind: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> FznsoValueKind

Function callback that returns the kind of the value.

fieldlen: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> usize

Function callback that returns the length of the value.

In case FznsoValueMethods::kind returns FznsoValueKind::FznsoValueString, the length is the number of bytes in the string not counting any trailing null byte. The pointer returned by FznsoValueMethods::as_string is not required to be null- terminated; callers must use this length to determine the string extent.

In case FznsoValueMethods::kind returns FznsoValueKind::FznsoValueList, the length is the number of elements in the list, accessible using FznsoValueMethods::get_element.

In case FznsoValueMethods::kind returns FznsoValueKind::FznsoValueSetInt or FznsoValueKind::FznsoValueSetFloat, the length is the number of ranges in the set, accessible using FznsoValueMethods::get_range_int or FznsoValueMethods::get_range_float.

Requires FznsoValueMethods::kind to return one of FznsoValueKind::FznsoValueString, FznsoValueKind::FznsoValueList, FznsoValueKind::FznsoValueSetInt, or FznsoValueKind::FznsoValueSetFloat.

fieldas_decision: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> FznsoDecisionIdx

Function callback that returns the decision variable index contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueDecision.

fieldas_constraint: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> FznsoConstraintIdx

Function callback that returns the constraint index contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueConstraint.

fieldas_int: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> i64

Function callback that returns the integer value contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueInt.

fieldas_float: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> f64

Function callback that returns the floating point value contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueFloat.

fieldas_string: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> *const ffi::c_char

Function callback that returns a pointer to the UTF-8 bytes of a string value. The pointer is valid for FznsoValueMethods::len bytes and is not required to be null-terminated (a trailing null byte may or may not be present).

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueString.

fieldas_bool: extern "C" fn(FznsoPtr<'_, FznsoValue>) -> bool

Function callback that returns the Boolean value contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueBool.

fieldget_range_int: extern "C" fn(FznsoPtr<'_, FznsoValue>, index: usize) -> FznsoIntRange

Function callback that returns a range from a range list representing the integer set contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueSetInt, and index to be below FznsoValueMethods::len.

fieldget_range_float: extern "C" fn(FznsoPtr<'_, FznsoValue>, index: usize) -> FznsoFloatRange

Function callback that returns a range from a range list representing the floating point set contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueSetFloat, and index to be below FznsoValueMethods::len.

fieldget_element: extern "C" fn(FznsoPtr<'_, FznsoValue>, index: usize) -> FznsoValueRef<'_>

Function callback that returns an element from the list contained in the value.

Requires FznsoValueMethods::kind to return FznsoValueKind::FznsoValueList, and index to be below FznsoValueMethods::len.

struct FznsoValueRef<'a>source

A value together with the callbacks that read it.

fielddata: FznsoPtr<'a, FznsoValue>

The data pointer to be the first argument of get_value.

fieldmethods: &'static FznsoValueMethods

Reference to the structure containing the function callbacks used to interact with the value.

methodfn get_bool(&self) -> bool

Rust call to FznsoValueMethods::as_bool with the FznsoValueRef::data attribute.

methodfn get_constraint(&self) -> FznsoConstraintIdx

Rust call to FznsoValueMethods::as_constraint with the FznsoValueRef::data attribute.

methodfn get_decision(&self) -> FznsoDecisionIdx

Rust call to FznsoValueMethods::as_decision with the FznsoValueRef::data attribute.

methodfn get_element(&self, idx: usize) -> FznsoValueRef<'a>

Rust call to FznsoValueMethods::get_element with the FznsoValueRef::data attribute.

methodfn get_float(&self) -> f64

Rust call to FznsoValueMethods::as_float with the FznsoValueRef::data attribute.

methodfn get_int(&self) -> i64

Rust call to FznsoValueMethods::as_int with the FznsoValueRef::data attribute.

methodfn get_range_float(&self, idx: usize) -> (f64, f64)

Rust call to FznsoValueMethods::get_range_float with the FznsoValueRef::data attribute.

methodfn get_range_int(&self, idx: usize) -> (i64, i64)

Rust call to FznsoValueMethods::get_range_int with the FznsoValueRef::data attribute.

methodfn get_string(&self) -> &'a str

Rust call to FznsoValueMethods::as_string and FznsoValueMethods::len to obtain the string as a &str.

The returned slice is valid for the lifetime of the value. The underlying bytes are not required to be null-terminated.

methodfn is_empty(&self) -> bool

Wrapper for a call to FznsoValueMethods::len with the FznsoValueRef::data attribute, returning true if the len is zero.

methodfn kind(&self) -> FznsoValueKind

Rust call to FznsoValueMethods::kind with the FznsoValueRef::data attribute.

methodfn len(&self) -> usize

Rust call to FznsoValueMethods::len with the FznsoValueRef::data attribute.

enum FznsoStatussource

The status returned by fznso_solver_run, indicating whether the solver completed its search.

variantFznsoComplete

The solver explored the full search space and yielded all relevant solutions.

variantFznsoIncomplete

The solver did not explore the full search space due to a timeout or other termination condition. Additional (better) solutions might be possible.

variantFznsoError

An error occurred during the solver’s execution.

fznso_<name>_solver_read_error can be used to retrieve the error message.

enum FznsoTypeBasesource

Representation of the base type of a value.

variantFznsoTypeBaseBool

Boolean type

variantFznsoTypeBaseInt

Integer numeric type

variantFznsoTypeBaseFloat

Floating point numeric type

variantFznsoTypeBaseString

Character string type

enum FznsoValueKindsource

Enumerated type used to mark the kind of FznsoValue. This is used to determine which “get” method in FznsoValueMethods is safe to call.

variantFznsoValueAbsent

No value is available.

variantFznsoValueDecision

The value is available using FznsoValueMethods::as_decision.

variantFznsoValueConstraint

The value is available using FznsoValueMethods::as_constraint.

variantFznsoValueBool

The value is available using FznsoValueMethods::as_bool.

variantFznsoValueInt

The value is available using FznsoValueMethods::as_int.

variantFznsoValueFloat

The value is available using FznsoValueMethods::as_float.

variantFznsoValueString

The value is available using FznsoValueMethods::as_string.

variantFznsoValueSetInt

Sets of integers are represented using a range list. The number of ranges is available using FznsoValueMethods::len, and the ranges can be accessed using FznsoValueMethods::get_range_int.

variantFznsoValueSetFloat

Sets of floats are represented using a range list. The number of ranges is available using FznsoValueMethods::len, and the ranges can be accessed using FznsoValueMethods::get_range_float.

variantFznsoValueList

The length of the list can be accessed using FznsoValueMethods::len, and elements in the list can be accessed using FznsoValueMethods::get_element

const FZNSO_ABI_VERSION: u32source

The FZnSO ABI version this crate defines.

A solver exports it as fznso_<name>_abi_version, and a loader rejects any solver whose reported version differs from its own.