Mountain/ApplicationState/DTO/TreeViewStateDTO.rs
1//! # TreeViewStateDTO
2//!
3//! Defines the Data Transfer Object for storing the state of a single
4//! registered tree view.
5
6#![allow(non_snake_case, non_camel_case_types)]
7
8use std::sync::Arc;
9
10use Common::TreeView::TreeViewProvider::TreeViewProvider;
11
12/// Holds the static options and provider for a tree view instance that has been
13/// registered by an extension or natively. This is stored in `ApplicationState`
14/// to track active tree views.
15///
16/// This struct holds references to either a native (Rust) provider or metadata
17/// for a proxied (extension) provider.
18///
19/// NOTE: This struct does not derive Serialize/Deserialize because `Arc<dyn
20/// ...>` is not serializable. It is intended for in-memory state management
21/// only.
22#[derive(Clone)]
23pub struct TreeViewStateDTO {
24 /// The unique identifier for this tree view.
25 pub ViewIdentifier:String,
26
27 /// A reference to the native provider, if one exists for this view.
28 /// This will be `None` for extension-provided (proxied) tree views.
29 pub Provider:Option<Arc<dyn TreeViewProvider + Send + Sync>>,
30
31 /// The identifier of the sidecar process that hosts the provider logic.
32 /// This will be `Some` for extension-provided (proxied) tree views.
33 pub SideCarIdentifier:Option<String>,
34
35 /// Whether the tree view supports selecting multiple items.
36 pub CanSelectMany:bool,
37
38 /// Whether the tree view supports drag and drop for its items.
39 pub HasHandleDrag:bool,
40
41 /// Whether the tree view supports dropping items onto it.
42 pub HasHandleDrop:bool,
43
44 /// An optional message to display in the tree view's UI.
45 pub Message:Option<String>,
46
47 /// The title of the tree view.
48 pub Title:Option<String>,
49
50 /// An optional description that appears with the title.
51 pub Description:Option<String>,
52}