pub struct DynPropertyData {
pub id: String,
pub name: String,
pub annotation: String,
pub variant: DynPropertyTypeData,
}
Expand description
Structure for sending data about dynamic properties to the frontend.
Some fields simplified compared to original typesafe versions (e.g., pure Strings
are used
instead of more complex typesafe structs) to allow for easier (de)serialization.
Fields§
§id: String
§name: String
§annotation: String
§variant: DynPropertyTypeData
Implementations§
source§impl DynPropertyData
impl DynPropertyData
sourcepub fn new_generic(
id: &str,
name: &str,
formula: &str,
annotation: &str,
) -> DynPropertyData
pub fn new_generic( id: &str, name: &str, formula: &str, annotation: &str, ) -> DynPropertyData
Shorthand to create new generic DynPropertyData
instance given a properties
id
, name
, formula
, and annotation
.
sourcepub fn from_property(
id: &DynPropertyId,
property: &DynProperty,
) -> DynPropertyData
pub fn from_property( id: &DynPropertyId, property: &DynProperty, ) -> DynPropertyData
Create new DynPropertyData
object given a reference to a property and its id
.
sourcepub fn to_property(&self) -> Result<DynProperty, String>
pub fn to_property(&self) -> Result<DynProperty, String>
Extract the corresponding DynProperty
instance from this DynPropertyData
.
sourcefn new_raw(
id: &str,
name: &str,
variant: DynPropertyTypeData,
annotation: &str,
) -> DynPropertyData
fn new_raw( id: &str, name: &str, variant: DynPropertyTypeData, annotation: &str, ) -> DynPropertyData
(internal) Shorthand to create new DynPropertyData
instance given all its fields.
Trait Implementations§
source§impl Clone for DynPropertyData
impl Clone for DynPropertyData
source§fn clone(&self) -> DynPropertyData
fn clone(&self) -> DynPropertyData
Returns a copy of the value. Read more
1.0.0 · 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 DynPropertyData
impl Debug for DynPropertyData
source§impl<'de> Deserialize<'de> for DynPropertyData
impl<'de> Deserialize<'de> for DynPropertyData
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<'de> JsonSerde<'de> for DynPropertyData
impl<'de> JsonSerde<'de> for DynPropertyData
source§fn to_json_str(&self) -> String
fn to_json_str(&self) -> String
Wrapper for json serialization.
source§fn to_pretty_json_str(&self) -> String
fn to_pretty_json_str(&self) -> String
Wrapper for pretty json serialization with indentation.
source§impl PartialEq for DynPropertyData
impl PartialEq for DynPropertyData
source§impl Serialize for DynPropertyData
impl Serialize for DynPropertyData
impl StructuralPartialEq for DynPropertyData
Auto Trait Implementations§
impl Freeze for DynPropertyData
impl RefUnwindSafe for DynPropertyData
impl Send for DynPropertyData
impl Sync for DynPropertyData
impl Unpin for DynPropertyData
impl UnwindSafe for DynPropertyData
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)