pub struct LayoutSnapshot { /* private fields */ }Expand description
Serializable snapshot of a LayoutRuntime
for session persistence.
Strategy runtimes serialize the recipe (strategy config + panel kinds). Non-strategy runtimes serialize the tree topology.
§Example
let mut rt = Layout::master_stack(["editor", "chat", "status"])
.master_ratio(0.6).gap(1.0).into_runtime().unwrap();
let snapshot = rt.snapshot();
// Serialize with any serde format:
// let json = serde_json::to_string(&snapshot).unwrap();
// Restore later:
let mut rt2 = panes::runtime::LayoutRuntime::from_snapshot(snapshot).unwrap();Implementations§
Trait Implementations§
Source§impl Clone for LayoutSnapshot
impl Clone for LayoutSnapshot
Source§fn clone(&self) -> LayoutSnapshot
fn clone(&self) -> LayoutSnapshot
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for LayoutSnapshot
impl RefUnwindSafe for LayoutSnapshot
impl Send for LayoutSnapshot
impl Sync for LayoutSnapshot
impl Unpin for LayoutSnapshot
impl UnsafeUnpin for LayoutSnapshot
impl UnwindSafe for LayoutSnapshot
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