pub struct NodeGraphEditorStateFile {
pub graph_id: GraphId,
pub editor_state_version: u32,
pub view_state: NodeGraphViewState,
pub editor_config: NodeGraphEditorConfig,
}Expand description
Project-scoped editor-state persistence file.
The graph document is saved separately by GraphFileV1; this file owns only user/editor state:
pure canvas view state plus persisted editor policy and runtime tuning.
Fields§
§graph_id: GraphIdGraph id.
editor_state_version: u32Editor-state schema version.
view_state: NodeGraphViewStatePure view-state payload.
editor_config: NodeGraphEditorConfigPersisted editor policy and runtime tuning.
Implementations§
Source§impl NodeGraphEditorStateFile
impl NodeGraphEditorStateFile
Sourcepub fn new(
graph_id: GraphId,
view_state: NodeGraphViewState,
editor_config: NodeGraphEditorConfig,
) -> Self
pub fn new( graph_id: GraphId, view_state: NodeGraphViewState, editor_config: NodeGraphEditorConfig, ) -> Self
Wraps editor state for a graph.
Sourcepub fn load_json(
path: impl AsRef<Path>,
graph_id: GraphId,
) -> Result<Self, NodeGraphEditorStateFileError>
pub fn load_json( path: impl AsRef<Path>, graph_id: GraphId, ) -> Result<Self, NodeGraphEditorStateFileError>
Loads a JSON file.
Sourcepub fn load_json_if_exists(
path: impl AsRef<Path>,
graph_id: GraphId,
) -> Result<Option<Self>, NodeGraphEditorStateFileError>
pub fn load_json_if_exists( path: impl AsRef<Path>, graph_id: GraphId, ) -> Result<Option<Self>, NodeGraphEditorStateFileError>
Loads the JSON file if it exists.
Trait Implementations§
Source§impl Clone for NodeGraphEditorStateFile
impl Clone for NodeGraphEditorStateFile
Source§fn clone(&self) -> NodeGraphEditorStateFile
fn clone(&self) -> NodeGraphEditorStateFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 NodeGraphEditorStateFile
impl Debug for NodeGraphEditorStateFile
Source§impl PartialEq for NodeGraphEditorStateFile
impl PartialEq for NodeGraphEditorStateFile
Source§fn eq(&self, other: &NodeGraphEditorStateFile) -> bool
fn eq(&self, other: &NodeGraphEditorStateFile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NodeGraphEditorStateFile
Auto Trait Implementations§
impl Freeze for NodeGraphEditorStateFile
impl RefUnwindSafe for NodeGraphEditorStateFile
impl Send for NodeGraphEditorStateFile
impl Sync for NodeGraphEditorStateFile
impl Unpin for NodeGraphEditorStateFile
impl UnsafeUnpin for NodeGraphEditorStateFile
impl UnwindSafe for NodeGraphEditorStateFile
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