pub enum LayoutIntent {
Show 14 variants
Insert {
node: LayoutNode,
magnified: bool,
focused: bool,
},
InsertAtIndex {
node: LayoutNode,
index_arr: Vec<i64>,
magnified: bool,
focused: bool,
},
Delete {
node_id: String,
},
Move {
node_id: String,
parent_id: Option<String>,
index: i64,
insert_at_root: bool,
},
MoveToEdge {
node_id: String,
edge: LayoutEdge,
size: Option<f64>,
},
Swap {
node1_id: String,
node2_id: String,
},
Resize {
resize_operations: Vec<LayoutResizeOp>,
},
Replace {
target_node_id: String,
new_node: LayoutNode,
focused: bool,
},
SplitHorizontal {
target_node_id: String,
new_node: LayoutNode,
position: SplitPosition,
size_fraction: Option<f64>,
focused: bool,
},
SplitVertical {
target_node_id: String,
new_node: LayoutNode,
position: SplitPosition,
size_fraction: Option<f64>,
focused: bool,
},
Minimize {
node_id: String,
},
Restore {
node_id: String,
},
Clear,
View,
}Expand description
A layout edit, applied by srv’s reducer to its own tree for the tab.
Nodes the intent adds (node, newNode) carry the id the sender gave
them; branches srv creates on the way get ids derived from the command’s
action id (backend::layout::intent::derive_node_id), so the sender can
predict the whole result.
Variants§
Insert
Add node at the first free slot (findNextInsertLocation).
InsertAtIndex
Add node after the slot an index path names.
Delete
Remove a node (and everything under it).
Move
Re-parent a node: the commit of a pane drag.
MoveToEdge
Move a pane to be a band across the whole layout: its width is the layout’s, at the top, the bottom or the middle of it, and the other panes keep their arrangement in the space that is left.
Fields
edge: LayoutEdgeSwap
Swap two nodes; each slot keeps its size.
Resize
Set node sizes: the commit of a divider drag. All or nothing.
Fields
resize_operations: Vec<LayoutResizeOp>Replace
Put newNode where targetNodeId is, keeping its size.
SplitHorizontal
Put newNode beside targetNodeId, in a row.
SplitVertical
Put newNode beside targetNodeId, in a column.
Minimize
Show a leaf as a header chip; its size is kept. Refused for the last pane still showing content.
Restore
Show a minimized leaf again.
Clear
Empty the tree.
View
No tree change: only the focused and magnified pane, which travel with every intent (a click, a magnify toggle).
Implementations§
Trait Implementations§
Source§impl Clone for LayoutIntent
impl Clone for LayoutIntent
Source§fn clone(&self) -> LayoutIntent
fn clone(&self) -> LayoutIntent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutIntent
impl Debug for LayoutIntent
Source§impl<'de> Deserialize<'de> for LayoutIntent
impl<'de> Deserialize<'de> for LayoutIntent
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>,
Source§impl PartialEq for LayoutIntent
impl PartialEq for LayoutIntent
Source§impl Serialize for LayoutIntent
impl Serialize for LayoutIntent
impl StructuralPartialEq for LayoutIntent
Source§impl TS for LayoutIntent
impl TS for LayoutIntent
Source§type WithoutGenerics = LayoutIntent
type WithoutGenerics = LayoutIntent
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = LayoutIntent
type OptionInnerType = LayoutIntent
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export]. Read more