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

Creating dynamic properties.

source

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.

source

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).

source

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.

source

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.

source

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).

source

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.

source

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.

source

pub fn default(variant: SimpleDynPropertyType) -> DynProperty

Create default DynProperty instance of specified variant.

source

pub fn default_generic() -> DynProperty

Create default “generic” DynProperty instance, representing “true” formula.

source

pub fn default_fixed_point() -> DynProperty

Create default DynProperty instance for the existence of a fixed point, with empty dataset and observation fields.

source

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.

source

pub fn default_trajectory() -> DynProperty

Create default DynProperty instance for the existence of a trajectory, with an empty datasetfield.

source

pub fn default_attractor_count() -> DynProperty

Create default DynProperty instance for the number of existing attractors, with default count being 1.

source

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

Editing dynamic properties.

source

pub fn set_name(&mut self, new_name: &str) -> Result<(), String>

Update property’s name.

source

pub fn set_annotation(&mut self, annotation: &str)

Set property’s annotation string.

source

pub fn set_dataset(&mut self, new_dataset: DatasetId) -> Result<(), String>

Update property’s sub-field dataset where applicable. If not applicable, return Err.

source

pub fn set_observation(&mut self, new_obs: ObservationId) -> Result<(), String>

Update property’s sub-field observation where applicable. If not applicable, return Err.

source

pub fn set_formula(&mut self, new_formula: &str) -> Result<(), String>

Update generic property’s formula. If not applicable (different variant), return Err.

source

pub fn remove_observation(&mut self) -> Result<(), String>

Update property’s sub-field observation to None where applicable. If not applicable, return Err.

source

pub fn set_attr_count( &mut self, minimal: usize, maximal: usize, ) -> Result<(), String>

Update property’s sub-fields, if the property is of AttractorCount variant. If not applicable, return Err.

source

pub fn set_trap_space_details( &mut self, is_minimal: bool, nonpercolable: bool, ) -> Result<(), String>

Update property’s sub-fields, if the property is of ExistsTrapSpace variant. If not applicable, return Err.

source§

impl DynProperty

Observing dynamic properties.

source

pub fn get_name(&self) -> &str

Get property’s name.

source

pub fn get_annotation(&self) -> &str

Get annotation string.

source

pub fn get_prop_data(&self) -> &DynPropertyType

Get property’s variant with all the underlying data.

source

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

source§

fn clone(&self) -> DynProperty

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DynProperty

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for DynProperty

source§

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 Hash for DynProperty

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for DynProperty

source§

fn eq(&self, other: &DynProperty) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for DynProperty

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for DynProperty

source§

impl StructuralPartialEq for DynProperty

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the [CommandItem]. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,