pub struct VariableData {
pub id: String,
pub name: String,
pub annotation: String,
pub update_fn: String,
}Expand description
Structure for sending data about Variable and its UpdateFn to the frontend.
VariableData contains similar fields as Variable and additional fields id and update_fn.
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§update_fn: StringImplementations§
source§impl VariableData
impl VariableData
sourcepub fn new(
id: &str,
name: &str,
annotation: &str,
update_fn: &str,
) -> VariableData
pub fn new( id: &str, name: &str, annotation: &str, update_fn: &str, ) -> VariableData
Create new VariableData object given a variable’s name and id string slices.
Trait Implementations§
source§impl Clone for VariableData
impl Clone for VariableData
source§fn clone(&self) -> VariableData
fn clone(&self) -> VariableData
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 VariableData
impl Debug for VariableData
source§impl<'de> Deserialize<'de> for VariableData
impl<'de> Deserialize<'de> for VariableData
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 VariableData
impl<'de> JsonSerde<'de> for VariableData
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 VariableData
impl PartialEq for VariableData
source§impl Serialize for VariableData
impl Serialize for VariableData
impl StructuralPartialEq for VariableData
Auto Trait Implementations§
impl Freeze for VariableData
impl RefUnwindSafe for VariableData
impl Send for VariableData
impl Sync for VariableData
impl Unpin for VariableData
impl UnwindSafe for VariableData
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)