pub struct DynProperty {
name: String,
annotation: String,
variant: DynPropertyType,
}
Expand description
A typesafe representation wrapping various kinds of dynamic properties.
Each property has a name
and field variant
encompassing inner data.
The formula that will be internally created (usually, apart from generic variant) depends on
particular type of the property - there are multiple variants
of properties, each carrying
its own different metadata that are later used to build the formula.
Fields§
§name: String
§annotation: String
§variant: DynPropertyType
Implementations§
source§impl DynProperty
impl DynProperty
Creating dynamic properties.
sourcefn new_raw(
name: &str,
variant: DynPropertyType,
annotation: &str,
) -> DynProperty
fn new_raw( name: &str, variant: DynPropertyType, annotation: &str, ) -> DynProperty
(internal) Shorthand to create a property given its already created internal
DynPropertyType
data, name, and annotation.
sourcepub fn try_mk_generic(
name: &str,
raw_formula: &str,
annotation: &str,
) -> Result<DynProperty, String>
pub fn try_mk_generic( name: &str, raw_formula: &str, annotation: &str, ) -> Result<DynProperty, String>
Create “generic” DynProperty
instance directly from a formula, which must be in a
correct format (which is verified).
sourcepub fn mk_fixed_point(
name: &str,
dataset: Option<DatasetId>,
observation: Option<ObservationId>,
annotation: &str,
) -> DynProperty
pub fn mk_fixed_point( name: &str, dataset: Option<DatasetId>, observation: Option<ObservationId>, annotation: &str, ) -> DynProperty
Create DynProperty
instance describing existence of a fixed point corresponding to
a given observation.
sourcepub fn mk_trap_space(
name: &str,
dataset: Option<DatasetId>,
observation: Option<ObservationId>,
minimal: bool,
nonpercolable: bool,
annotation: &str,
) -> DynProperty
pub fn mk_trap_space( name: &str, dataset: Option<DatasetId>, observation: Option<ObservationId>, minimal: bool, nonpercolable: bool, annotation: &str, ) -> DynProperty
Create DynProperty
instance describing existence of a trap space corresponding to
a given observation. Optionally, the trap space might be required to be minimal or
non-percolable.
sourcepub fn mk_trajectory(
name: &str,
dataset: Option<DatasetId>,
annotation: &str,
) -> DynProperty
pub fn mk_trajectory( name: &str, dataset: Option<DatasetId>, annotation: &str, ) -> DynProperty
Create DynProperty
instance describing existence of a trajectory corresponding to
observations from a given observation (in the given order).
sourcepub fn try_mk_attractor_count(
name: &str,
minimal: usize,
maximal: usize,
annotation: &str,
) -> Result<DynProperty, String>
pub fn try_mk_attractor_count( name: &str, minimal: usize, maximal: usize, annotation: &str, ) -> Result<DynProperty, String>
Create DynProperty
instance describing the number of existing attractors.
sourcepub fn mk_has_attractor(
name: &str,
dataset: Option<DatasetId>,
observation: Option<ObservationId>,
annotation: &str,
) -> DynProperty
pub fn mk_has_attractor( name: &str, dataset: Option<DatasetId>, observation: Option<ObservationId>, annotation: &str, ) -> DynProperty
Create DynProperty
instance describing the existence of an attractor corresponding to
a corresponding dataset, or some specific observation in it.
sourcepub fn default(variant: SimpleDynPropertyType) -> DynProperty
pub fn default(variant: SimpleDynPropertyType) -> DynProperty
Create default DynProperty
instance of specified variant.
sourcepub fn default_generic() -> DynProperty
pub fn default_generic() -> DynProperty
Create default “generic” DynProperty
instance, representing “true” formula.
sourcepub fn default_fixed_point() -> DynProperty
pub fn default_fixed_point() -> DynProperty
Create default DynProperty
instance for the existence of a fixed point, with empty
dataset
and observation
fields.
sourcepub fn default_trap_space() -> DynProperty
pub fn default_trap_space() -> DynProperty
Create default DynProperty
instance for the existence of a trap space, with empty
dataset
and observation
fields, and all flags set to false.
sourcepub fn default_trajectory() -> DynProperty
pub fn default_trajectory() -> DynProperty
Create default DynProperty
instance for the existence of a trajectory, with an empty
dataset
field.
sourcepub fn default_attractor_count() -> DynProperty
pub fn default_attractor_count() -> DynProperty
Create default DynProperty
instance for the number of existing attractors, with default
count being 1.
sourcepub fn default_has_attractor() -> DynProperty
pub fn default_has_attractor() -> DynProperty
Create default DynProperty
instance for the existence of an attractor with empty
dataset
and observation
fields.
source§impl DynProperty
impl DynProperty
Editing dynamic properties.
sourcepub fn set_annotation(&mut self, annotation: &str)
pub fn set_annotation(&mut self, annotation: &str)
Set property’s annotation string.
sourcepub fn set_dataset(&mut self, new_dataset: DatasetId) -> Result<(), String>
pub fn set_dataset(&mut self, new_dataset: DatasetId) -> Result<(), String>
Update property’s sub-field dataset
where applicable. If not applicable, return Err
.
sourcepub fn set_observation(&mut self, new_obs: ObservationId) -> Result<(), String>
pub fn set_observation(&mut self, new_obs: ObservationId) -> Result<(), String>
Update property’s sub-field observation
where applicable. If not applicable, return Err
.
sourcepub fn set_formula(&mut self, new_formula: &str) -> Result<(), String>
pub fn set_formula(&mut self, new_formula: &str) -> Result<(), String>
Update generic property’s formula. If not applicable (different variant), return Err
.
sourcepub fn remove_observation(&mut self) -> Result<(), String>
pub fn remove_observation(&mut self) -> Result<(), String>
Update property’s sub-field observation
to None where applicable. If not applicable,
return Err
.
source§impl DynProperty
impl DynProperty
Observing dynamic properties.
sourcepub fn get_annotation(&self) -> &str
pub fn get_annotation(&self) -> &str
Get annotation string.
sourcepub fn get_prop_data(&self) -> &DynPropertyType
pub fn get_prop_data(&self) -> &DynPropertyType
Get property’s variant with all the underlying data.
sourcepub fn assert_dataset_filled(&self) -> Result<(), String>
pub fn assert_dataset_filled(&self) -> Result<(), String>
Check that the property has all required fields filled out. That is just the dataset
in most cases at the moment.
If some of the required field is set to None, return error.
Trait Implementations§
source§impl Clone for DynProperty
impl Clone for DynProperty
source§fn clone(&self) -> DynProperty
fn clone(&self) -> DynProperty
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DynProperty
impl Debug for DynProperty
source§impl<'de> Deserialize<'de> for DynProperty
impl<'de> Deserialize<'de> for DynProperty
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>,
source§impl Hash for DynProperty
impl Hash for DynProperty
source§impl PartialEq for DynProperty
impl PartialEq for DynProperty
source§impl Serialize for DynProperty
impl Serialize for DynProperty
impl Eq for DynProperty
impl StructuralPartialEq for DynProperty
Auto Trait Implementations§
impl Freeze for DynProperty
impl RefUnwindSafe for DynProperty
impl Send for DynProperty
impl Sync for DynProperty
impl Unpin for DynProperty
impl UnwindSafe for DynProperty
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.