pub struct ConstraintEntry {
pub constraint_type: String,
pub input_params: Value,
pub persistent_data: Value,
pub enabled: bool,
pub open: bool,
}Expand description
One persisted constraint: { type, inputParams, persistentData, enabled, open }. inputParams carries id, elements (selection ref strings) and
the type-specific params; persistentData is the solver-state merge target
(status/message/diagnostics/orientation cache).
Fields§
§constraint_type: String§input_params: Value§persistent_data: Value§enabled: bool§open: boolImplementations§
Source§impl ConstraintEntry
impl ConstraintEntry
Sourcepub fn elements(&self) -> Vec<String>
pub fn elements(&self) -> Vec<String>
The selection refs (inputParams.elements), string entries only.
Sourcepub fn number(&self, key: &str, env: &Env, default: f64) -> Result<f64, String>
pub fn number(&self, key: &str, env: &Env, default: f64) -> Result<f64, String>
A numeric param, expression-capable (a string evaluates against the
part’s expression scope — requirements §3). Absent → default.
Sourcepub fn set_persistent(&mut self, key: &str, value: Value)
pub fn set_persistent(&mut self, key: &str, value: Value)
Merge a key into persistentData (created as an object when missing).
Sourcepub fn remove_persistent(&mut self, key: &str)
pub fn remove_persistent(&mut self, key: &str)
Remove a key from persistentData (no-op when absent).
Sourcepub fn persistent(&self, key: &str) -> Option<&Value>
pub fn persistent(&self, key: &str) -> Option<&Value>
A persistentData field, if present.
Trait Implementations§
Source§impl Clone for ConstraintEntry
impl Clone for ConstraintEntry
Source§fn clone(&self) -> ConstraintEntry
fn clone(&self) -> ConstraintEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstraintEntry
impl Debug for ConstraintEntry
Source§impl<'de> Deserialize<'de> for ConstraintEntry
impl<'de> Deserialize<'de> for ConstraintEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConstraintEntry
impl PartialEq for ConstraintEntry
Source§impl Serialize for ConstraintEntry
impl Serialize for ConstraintEntry
impl StructuralPartialEq for ConstraintEntry
Auto Trait Implementations§
impl Freeze for ConstraintEntry
impl RefUnwindSafe for ConstraintEntry
impl Send for ConstraintEntry
impl Sync for ConstraintEntry
impl Unpin for ConstraintEntry
impl UnsafeUnpin for ConstraintEntry
impl UnwindSafe for ConstraintEntry
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
Mutably borrows from an owned value. Read more