pub struct ParametricInstance {
pub description: Option<Description>,
pub annotations: HashMap<String, String>,
/* private fields */
}Expand description
Optimization problem instance with parameters
§Mathematical operations
ParametricInstance owns the same root operations as Instance and also
owns the parameter-specialization operation. Parameter IDs share the
VariableID namespace with decision variables, so only the enclosing
parametric instance can interpret an expression reference as a decision
variable or a parameter.
Self::with_parameters applies a parameter assignment to produce a
concrete Instance. This is a root operation: it substitutes parameter
values out of every expression-bearing component while preserving structural
constraint families whose member IDs must already be real decision
variables.
§Invariants
Self::decision_variablesowns theDecisionVariableTable: row IDs, decision-variable modeling labels, and fixed values share one table owner.- The decision-variable table rejects labels or fixed values for unknown variable IDs, and fixed values must satisfy the corresponding row’s kind/bound.
Self::parametersowns the parameter ID universe and parameter modeling labels throughParameterTable. Parameter IDs intentionally useVariableIDrather than a separateParameterID, because algebraic expressions cannot distinguish decision-variable references from parameter references without the enclosing root.Self::decision_variablesandSelf::parameterstogether contain every ID that may appear in the objective, output objective, regular/indicator constraint bodies, named functions, and dependency RHS expressions.- The IDs of
Self::decision_variablesandSelf::parametersare disjoint sets. This shared-namespace invariant is host-level state and is validated byParametricInstance::builder/ protobuf parsing, not byParameterTablealone. - The keys of
Self::constraintsandSelf::removed_constraintsare disjoint sets. - The keys of
Self::decision_variable_dependencymust be inSelf::decision_variables, but must NOT be used in the active objective or active constraints. The RHS expressions ofSelf::decision_variable_dependencymay reference IDs fromSelf::decision_variablesorSelf::parameters, and may not reference undefined IDs. Parameter IDs in RHS expressions are evaluated bySelf::with_parameters. Self::output_objectivehas the same atomic sense/function/optimality semantics asInstance::output_objective. Its function may reference decision-variable or parameter IDs, including fixed, dependent, or otherwise inactive decision variables. Parameter references are specialized bySelf::with_parametersbefore the pair is installed on the resultingInstance.- Decision variables are classified into mutually exclusive roles:
- used: Variable IDs appearing in the active objective or active constraints
- fixed: Variable IDs present in
Self::fixed_decision_variable_valuesand not used - dependent: Keys of
decision_variable_dependencythat are not used or fixed
DecisionVariableUsageis the reverse-usage index for used decision variables only.Self::named_functionsis keyed by the table-ownedNamedFunctionID; named-function rows do not carry IDs.Self::named_functionsmay contain fixed or dependent decision-variable IDs (likeremoved_constraints) and may also reference parameter IDs. Every referenced ID must be registered in eitherSelf::decision_variablesorSelf::parameters, but decision-variable IDs appearing only in named functions are NOT included in the “used” set calculation.- Modeling-label and constraint-context sidecars are owned by their
corresponding top-level table or collection; every label/context ID must
refer to an existing decision variable, parameter, named function, or
active/removed constraint in that owner. Parameter labels are owned by
ParameterTable; parameter IDs are not valid variable-label IDs. - Fixed decision-variable values are owned by
DecisionVariableTable. The rootParametricInstanceowns the host-level invariant that fixed IDs are disjoint from solver-used and dependent variables, and from parameter IDs via the shared namespace rule.
§Special-constraint invariants
The same special-constraint invariants apply as on Instance, with one
key difference: function bodies in indicator and regular constraints may
reference parameter IDs (which are substituted via
Self::with_parameters), but structural variable positions cannot
— they must be real decision variables. Specifically:
- For every active or removed
crate::IndicatorConstraint, theindicator_variableis registered inSelf::decision_variables(notSelf::parameters) and hasKind::Binary. The function body may reference any defined variable or parameter. - For every active or removed
crate::OneHotConstraint, every member ofvariablesis registered inSelf::decision_variablesand hasKind::Binary. - For every active or removed
crate::Sos1Constraint,variablesis non-empty and every member is registered inSelf::decision_variables. - The constraint id-disjointness invariants (active vs. removed, per kind)
match
Instance.
These invariants are enforced at every construction or mutation entry
point: ParametricInstance::builder (which mirrors
Instance::builder and accepts active maps for all three kinds, plus
removed maps for regular and indicator constraints, validating each),
and the post-construction setters Self::add_constraint /
Self::add_indicator_constraint / Self::add_one_hot_constraint /
Self::add_sos1_constraint.
Self::with_parameters partially evaluates parameter IDs out of every
expression that could contain one when materializing a parametric
instance into an Instance: the active objective, output objective,
active and removed regular constraint bodies, active and removed indicator
constraint function bodies, named functions, and
decision_variable_dependency RHS expressions. OneHot/SOS1 collections
(active and removed) pass through unchanged because their variable sets are
required to be real decision variables at construction time. The resulting
Instance satisfies its own (stricter) invariants — no parameter IDs
survive anywhere.
Fields§
§description: Option<Description>§annotations: HashMap<String, String>User-defined or third-party extension annotations.
OMMX-reserved metadata is represented by explicit fields such as
Self::description.
Implementations§
Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn with_parameters(self, parameters: Parameters) -> Result<Instance>
pub fn with_parameters(self, parameters: Parameters) -> Result<Instance>
Materialize every parameter into an Instance.
§Postconditions
Materialization removes parameter IDs from both active and output objectives. An existing output objective remains explicit even if specialization makes it structurally equal to the active objective.
use ommx::{
linear, v1::{Parameters, State}, ATol, Constraint, ConstraintID,
DecisionVariable, Evaluate, Function, Instance, Sense, VariableID,
};
use std::collections::{BTreeMap, HashMap};
let variable = VariableID::from(1);
let source = Instance::builder()
.sense(Sense::Minimize)
.objective(Function::from(linear!(1)))
.decision_variables(BTreeMap::from([(variable, DecisionVariable::binary())]))
.constraints(BTreeMap::from([(
ConstraintID::from(1),
Constraint::equal_to_zero(Function::from(linear!(1))),
)]))
.build()
.unwrap();
let parametric = source.uniform_penalty_method().unwrap();
let penalty = *parametric.parameters().keys().next().unwrap();
let mut parameters = Parameters::default();
parameters.entries.insert(penalty.into_inner(), 2.0);
let instance = parametric.with_parameters(parameters).unwrap();
assert!(instance.objective().required_ids().contains(&variable));
assert!(!instance.objective().required_ids().contains(&penalty));
assert_eq!(instance.output_objective().unwrap().sense(), Sense::Minimize);
assert!(!instance.output_objective().unwrap().preserves_optimality());
let solution = instance
.evaluate(&State::from(HashMap::from([(1, 0.0)])), ATol::default())
.unwrap();
assert_eq!(*solution.objective(), 0.0);Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn format_summary(&self) -> String
pub fn format_summary(&self) -> String
Format a compact, context-aware summary of this parametric instance.
This is intended for user-facing print(instance) / Display output.
It resolves decision-variable and parameter labels through the
parametric instance while keeping large expressions bounded.
Sourcepub fn format_function(&self, function: &Function) -> Result<String>
pub fn format_function(&self, function: &Function) -> Result<String>
Format a function using this parametric instance’s decision-variable and parameter modeling labels.
This validates that every ID referenced by function belongs to exactly
one of the decision-variable table or parameter table before applying
any output budget.
Sourcepub fn format_function_with(
&self,
function: &Function,
opts: FunctionFormatOptions,
) -> Result<FormattedFunction>
pub fn format_function_with( &self, function: &Function, opts: FunctionFormatOptions, ) -> Result<FormattedFunction>
Format a function using this parametric instance’s decision-variable and parameter modeling labels and explicit output limits.
An ID that resolves as both a decision variable and a parameter, or as neither, is rejected before any term or character truncation is applied.
Source§impl ParametricInstance
impl ParametricInstance
pub fn new( sense: Sense, objective: Function, decision_variables: BTreeMap<VariableID, DecisionVariable>, parameters: ParameterTable, constraints: BTreeMap<ConstraintID, Constraint>, ) -> Result<Self>
Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn builder() -> ParametricInstanceBuilder
pub fn builder() -> ParametricInstanceBuilder
Creates a new ParametricInstanceBuilder.
Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn to_v1_bytes(&self) -> Result<Vec<u8>>
pub fn to_v1_bytes(&self) -> Result<Vec<u8>>
Serialize this parametric instance using the v1 wire format.
§Errors
ommx.v1.ParametricInstance cannot represent the presence of a
ParametricInstance::output_objective, even when it currently matches
the active objective.
use ommx::{linear, DecisionVariable, Function, Instance, ParametricInstance, Sense, VariableID};
use std::collections::BTreeMap;
let mut source = Instance::builder()
.sense(Sense::Maximize)
.objective(Function::from(linear!(1)))
.decision_variables(BTreeMap::from([(
VariableID::from(1),
DecisionVariable::binary(),
)]))
.constraints(BTreeMap::new())
.build()
.unwrap();
assert!(source.convert_active_objective(Sense::Minimize));
assert!(source.convert_active_objective(Sense::Maximize));
let instance = ParametricInstance::from(source);
assert_eq!(instance.output_objective().unwrap().function(), instance.objective());
assert!(instance.to_v1_bytes().is_err());Sourcepub fn to_v2_bytes(&self) -> Vec<u8> ⓘ
pub fn to_v2_bytes(&self) -> Vec<u8> ⓘ
Serialize this parametric instance using the v2 wire format.
§Postconditions
v2 serialization round-trips the parametric output objective.
use ommx::{linear, DecisionVariable, Function, Instance, ParametricInstance, Sense, VariableID};
use std::collections::BTreeMap;
let mut source = Instance::builder()
.sense(Sense::Maximize)
.objective(Function::from(linear!(1)))
.decision_variables(BTreeMap::from([(
VariableID::from(1),
DecisionVariable::binary(),
)]))
.constraints(BTreeMap::new())
.build()
.unwrap();
assert!(source.convert_active_objective(Sense::Minimize));
let instance = ParametricInstance::from(source);
let restored = ParametricInstance::from_v2_bytes(&instance.to_v2_bytes()).unwrap();
assert_eq!(restored.output_objective().unwrap().sense(), Sense::Maximize);
assert_eq!(restored, instance);pub fn from_v1_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_v2_bytes(bytes: &[u8]) -> Result<Self>
Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn add_constraint(
&mut self,
constraint: Constraint,
context: ConstraintContext,
) -> Result<ConstraintID>
pub fn add_constraint( &mut self, constraint: Constraint, context: ConstraintContext, ) -> Result<ConstraintID>
Insert a new constraint with its context, picking an unused id.
Mirrors Instance::add_constraint for parametric instances.
Returns the newly assigned ConstraintID. The context is drained
into the per-constraint ConstraintContextStore; pass
ConstraintContext::default for an
unannotated constraint.
All IDs referenced by the constraint must already be present in either
decision_variables or parameters, and must not be substitution-
dependency keys.
Sourcepub fn add_indicator_constraint(
&mut self,
constraint: IndicatorConstraint,
context: ConstraintContext,
) -> Result<IndicatorConstraintID>
pub fn add_indicator_constraint( &mut self, constraint: IndicatorConstraint, context: ConstraintContext, ) -> Result<IndicatorConstraintID>
Insert a new indicator constraint with its context, picking an unused id.
Mirrors Instance::add_indicator_constraint for parametric
instances. The function body may reference either decision variables
or parameters, but the indicator variable itself must be a binary
decision variable — substitution cannot replace a structural variable
position, and the indicator semantics require Kind::Binary.
Sourcepub fn add_one_hot_constraint(
&mut self,
constraint: OneHotConstraint,
context: ConstraintContext,
) -> Result<OneHotConstraintID>
pub fn add_one_hot_constraint( &mut self, constraint: OneHotConstraint, context: ConstraintContext, ) -> Result<OneHotConstraintID>
Insert a new one-hot constraint with its context, picking an unused id.
The one-hot set must be non-empty. All variables in the set are structural and must be binary decision variables (parameter ids and non-binary kinds are rejected). Dependency keys are also rejected.
Sourcepub fn add_sos1_constraint(
&mut self,
constraint: Sos1Constraint,
context: ConstraintContext,
) -> Result<Sos1ConstraintID>
pub fn add_sos1_constraint( &mut self, constraint: Sos1Constraint, context: ConstraintContext, ) -> Result<Sos1ConstraintID>
Insert a new SOS1 constraint with its context, picking an unused id.
All variables in the SOS1 set are structural and must be decision
variables (parameter ids are rejected). The set must be non-empty.
Dependency keys are also rejected. Unlike one-hot, SOS1 does not
require Kind::Binary.
Sourcepub fn add_decision_variable(
&mut self,
id: VariableID,
variable: DecisionVariable,
label: DecisionVariableLabel,
) -> Result<VariableID>
pub fn add_decision_variable( &mut self, id: VariableID, variable: DecisionVariable, label: DecisionVariableLabel, ) -> Result<VariableID>
Insert a decision variable with its modeling label.
The table key must not collide with any existing decision variable, parameter, or substitution-dependency key.
§Errors
Returns an error whose chain contains
crate::DecisionVariableError::DuplicateID when id is already
owned by a decision variable, or
crate::ParameterIDCollision when it is already owned by a
parameter.
Source§impl ParametricInstance
impl ParametricInstance
pub fn sense(&self) -> &Sense
pub fn objective(&self) -> &Function
pub fn parameters(&self) -> &ParameterTable
pub fn decision_variable_dependency(&self) -> &AcyclicAssignments
Source§impl ParametricInstance
impl ParametricInstance
Sourcepub fn output_objective(&self) -> Option<&OutputObjective>
pub fn output_objective(&self) -> Option<&OutputObjective>
Return the preserved objective semantics used after specialization.
None means the active Self::sense and Self::objective define
the output semantics directly.
Sourcepub fn decision_variable_table(&self) -> &DecisionVariableTable
pub fn decision_variable_table(&self) -> &DecisionVariableTable
Access the decision-variable definition table.
Sourcepub fn decision_variables(&self) -> &BTreeMap<VariableID, DecisionVariable>
pub fn decision_variables(&self) -> &BTreeMap<VariableID, DecisionVariable>
Access decision-variable rows keyed by table-owned IDs.
Sourcepub fn variable_labels(&self) -> &VariableLabelStore
pub fn variable_labels(&self) -> &VariableLabelStore
Access the per-variable modeling-label store.
Sourcepub fn set_variable_label(
&mut self,
id: VariableID,
label: ModelingLabel,
) -> Result<()>
pub fn set_variable_label( &mut self, id: VariableID, label: ModelingLabel, ) -> Result<()>
Replace the modeling label for a decision variable owned by this parametric instance.
Sourcepub fn fixed_decision_variable_values(&self) -> &BTreeMap<VariableID, f64>
pub fn fixed_decision_variable_values(&self) -> &BTreeMap<VariableID, f64>
Access table-owned fixed decision-variable values.
Sourcepub fn fixed_decision_variable_value(&self, id: VariableID) -> Option<f64>
pub fn fixed_decision_variable_value(&self, id: VariableID) -> Option<f64>
Return the fixed value for one decision variable, if it is fixed.
Sourcepub fn named_function_table(&self) -> &NamedFunctionTable<NamedFunction>
pub fn named_function_table(&self) -> &NamedFunctionTable<NamedFunction>
Access named-function rows plus their modeling labels.
Sourcepub fn named_functions(&self) -> &BTreeMap<NamedFunctionID, NamedFunction>
pub fn named_functions(&self) -> &BTreeMap<NamedFunctionID, NamedFunction>
Access named-function row payloads keyed by table-owned IDs.
Sourcepub fn named_function_labels(&self) -> &NamedFunctionLabelStore
pub fn named_function_labels(&self) -> &NamedFunctionLabelStore
Access the per-named-function modeling-label store.
Sourcepub fn set_named_function_label(
&mut self,
id: NamedFunctionID,
label: ModelingLabel,
) -> Result<()>
pub fn set_named_function_label( &mut self, id: NamedFunctionID, label: ModelingLabel, ) -> Result<()>
Replace the modeling label for a named function owned by this parametric instance.
Sourcepub fn constraints(&self) -> &BTreeMap<ConstraintID, Constraint>
pub fn constraints(&self) -> &BTreeMap<ConstraintID, Constraint>
Active constraints.
Sourcepub fn removed_constraints(
&self,
) -> &BTreeMap<ConstraintID, (Constraint, RemovedReason)>
pub fn removed_constraints( &self, ) -> &BTreeMap<ConstraintID, (Constraint, RemovedReason)>
Removed constraints.
Sourcepub fn constraint_collection(&self) -> &ConstraintCollection<Constraint>
pub fn constraint_collection(&self) -> &ConstraintCollection<Constraint>
The full constraint collection (active + removed).
Sourcepub fn constraint_context(&self) -> &ConstraintContextStore<ConstraintID>
pub fn constraint_context(&self) -> &ConstraintContextStore<ConstraintID>
Access the per-constraint context store.
Sourcepub fn set_constraint_context(
&mut self,
id: ConstraintID,
context: ConstraintContext,
) -> Result<()>
pub fn set_constraint_context( &mut self, id: ConstraintID, context: ConstraintContext, ) -> Result<()>
Replace the context for a regular constraint owned by this parametric instance.
Sourcepub fn indicator_constraints(
&self,
) -> &BTreeMap<IndicatorConstraintID, IndicatorConstraint>
pub fn indicator_constraints( &self, ) -> &BTreeMap<IndicatorConstraintID, IndicatorConstraint>
Active indicator constraints.
Sourcepub fn removed_indicator_constraints(
&self,
) -> &BTreeMap<IndicatorConstraintID, (IndicatorConstraint, RemovedReason)>
pub fn removed_indicator_constraints( &self, ) -> &BTreeMap<IndicatorConstraintID, (IndicatorConstraint, RemovedReason)>
Removed indicator constraints.
Sourcepub fn indicator_constraint_collection(
&self,
) -> &ConstraintCollection<IndicatorConstraint>
pub fn indicator_constraint_collection( &self, ) -> &ConstraintCollection<IndicatorConstraint>
The full indicator constraint collection.
Sourcepub fn indicator_constraint_context(
&self,
) -> &ConstraintContextStore<IndicatorConstraintID>
pub fn indicator_constraint_context( &self, ) -> &ConstraintContextStore<IndicatorConstraintID>
Access the per-indicator-constraint context store.
Sourcepub fn set_indicator_constraint_context(
&mut self,
id: IndicatorConstraintID,
context: ConstraintContext,
) -> Result<()>
pub fn set_indicator_constraint_context( &mut self, id: IndicatorConstraintID, context: ConstraintContext, ) -> Result<()>
Replace the context for an indicator constraint owned by this parametric instance.
Sourcepub fn one_hot_constraints(
&self,
) -> &BTreeMap<OneHotConstraintID, OneHotConstraint>
pub fn one_hot_constraints( &self, ) -> &BTreeMap<OneHotConstraintID, OneHotConstraint>
Active one-hot constraints.
Sourcepub fn removed_one_hot_constraints(
&self,
) -> &BTreeMap<OneHotConstraintID, (OneHotConstraint, RemovedReason)>
pub fn removed_one_hot_constraints( &self, ) -> &BTreeMap<OneHotConstraintID, (OneHotConstraint, RemovedReason)>
Removed one-hot constraints.
Sourcepub fn one_hot_constraint_collection(
&self,
) -> &ConstraintCollection<OneHotConstraint>
pub fn one_hot_constraint_collection( &self, ) -> &ConstraintCollection<OneHotConstraint>
The full one-hot constraint collection.
Sourcepub fn one_hot_constraint_context(
&self,
) -> &ConstraintContextStore<OneHotConstraintID>
pub fn one_hot_constraint_context( &self, ) -> &ConstraintContextStore<OneHotConstraintID>
Access the per-one-hot-constraint context store.
Sourcepub fn set_one_hot_constraint_context(
&mut self,
id: OneHotConstraintID,
context: ConstraintContext,
) -> Result<()>
pub fn set_one_hot_constraint_context( &mut self, id: OneHotConstraintID, context: ConstraintContext, ) -> Result<()>
Replace the context for a one-hot constraint owned by this parametric instance.
Sourcepub fn sos1_constraints(&self) -> &BTreeMap<Sos1ConstraintID, Sos1Constraint>
pub fn sos1_constraints(&self) -> &BTreeMap<Sos1ConstraintID, Sos1Constraint>
Active SOS1 constraints.
Sourcepub fn removed_sos1_constraints(
&self,
) -> &BTreeMap<Sos1ConstraintID, (Sos1Constraint, RemovedReason)>
pub fn removed_sos1_constraints( &self, ) -> &BTreeMap<Sos1ConstraintID, (Sos1Constraint, RemovedReason)>
Removed SOS1 constraints.
Sourcepub fn sos1_constraint_collection(
&self,
) -> &ConstraintCollection<Sos1Constraint>
pub fn sos1_constraint_collection( &self, ) -> &ConstraintCollection<Sos1Constraint>
The full SOS1 constraint collection.
Sourcepub fn sos1_constraint_context(
&self,
) -> &ConstraintContextStore<Sos1ConstraintID>
pub fn sos1_constraint_context( &self, ) -> &ConstraintContextStore<Sos1ConstraintID>
Access the per-SOS1-constraint context store.
Sourcepub fn set_sos1_constraint_context(
&mut self,
id: Sos1ConstraintID,
context: ConstraintContext,
) -> Result<()>
pub fn set_sos1_constraint_context( &mut self, id: Sos1ConstraintID, context: ConstraintContext, ) -> Result<()>
Replace the context for an SOS1 constraint owned by this parametric instance.
Trait Implementations§
Source§impl Clone for ParametricInstance
impl Clone for ParametricInstance
Source§fn clone(&self) -> ParametricInstance
fn clone(&self) -> ParametricInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParametricInstance
impl Debug for ParametricInstance
Source§impl Default for ParametricInstance
impl Default for ParametricInstance
Source§fn default() -> ParametricInstance
fn default() -> ParametricInstance
Source§impl Display for ParametricInstance
impl Display for ParametricInstance
Source§impl FlatAnnotations for ParametricInstance
impl FlatAnnotations for ParametricInstance
Source§impl From<Instance> for ParametricInstance
impl From<Instance> for ParametricInstance
Source§impl From<ParametricInstance> for ParametricInstance
impl From<ParametricInstance> for ParametricInstance
Source§fn from(value: ParametricInstance) -> Self
fn from(value: ParametricInstance) -> Self
Source§impl PartialEq for ParametricInstance
impl PartialEq for ParametricInstance
impl StructuralPartialEq for ParametricInstance
Source§impl Substitute for ParametricInstance
impl Substitute for ParametricInstance
type Output = ParametricInstance
Source§fn substitute_acyclic(
self,
acyclic: &AcyclicAssignments,
) -> Result<Self::Output, SubstitutionError>
fn substitute_acyclic( self, acyclic: &AcyclicAssignments, ) -> Result<Self::Output, SubstitutionError>
Source§fn substitute_one(
self,
assigned: VariableID,
f: &Function,
) -> Result<Self::Output, SubstitutionError>
fn substitute_one( self, assigned: VariableID, f: &Function, ) -> Result<Self::Output, SubstitutionError>
Source§fn substitute(
self,
assignments: impl IntoIterator<Item = (VariableID, Function)>,
) -> Result<Self::Output, SubstitutionError>
fn substitute( self, assignments: impl IntoIterator<Item = (VariableID, Function)>, ) -> Result<Self::Output, SubstitutionError>
Source§impl TryFrom<ParametricInstance> for ParametricInstance
impl TryFrom<ParametricInstance> for ParametricInstance
Source§type Error = ParseError
type Error = ParseError
Auto Trait Implementations§
impl Freeze for ParametricInstance
impl RefUnwindSafe for ParametricInstance
impl Send for ParametricInstance
impl Sync for ParametricInstance
impl Unpin for ParametricInstance
impl UnsafeUnpin for ParametricInstance
impl UnwindSafe for ParametricInstance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more