Struct biodivine_sketchbook::sketchbook::data_structs::LayoutData
source · pub struct LayoutData {
pub id: String,
pub name: String,
pub nodes: Vec<LayoutNodeData>,
}
Expand description
Structure for sending simplified general data about Layout
to the frontend.
LayoutData
does not have the exact same fields as Layout
(for instance, id
is added).
Some fields of LayoutData
are simplified compared to Layout
(e.g., pure Strings
instead
of more complex typesafe structs) to allow for easier (de)serialization.
See also LayoutNodeData for a sub-structure to carry data regarding individual NodeLayouts
.
Fields§
§id: String
§name: String
§nodes: Vec<LayoutNodeData>
Implementations§
source§impl LayoutData
impl LayoutData
sourcepub fn from_layout(layout_id: &LayoutId, layout: &Layout) -> LayoutData
pub fn from_layout(layout_id: &LayoutId, layout: &Layout) -> LayoutData
Create new LayoutData
instance given a layout
and its id.
Trait Implementations§
source§impl Clone for LayoutData
impl Clone for LayoutData
source§fn clone(&self) -> LayoutData
fn clone(&self) -> LayoutData
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 LayoutData
impl Debug for LayoutData
source§impl<'de> Deserialize<'de> for LayoutData
impl<'de> Deserialize<'de> for LayoutData
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 LayoutData
impl<'de> JsonSerde<'de> for LayoutData
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 LayoutData
impl PartialEq for LayoutData
source§impl Serialize for LayoutData
impl Serialize for LayoutData
impl StructuralPartialEq for LayoutData
Auto Trait Implementations§
impl Freeze for LayoutData
impl RefUnwindSafe for LayoutData
impl Send for LayoutData
impl Sync for LayoutData
impl Unpin for LayoutData
impl UnwindSafe for LayoutData
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
)