pub trait TreeViewProvider:
Environment
+ Send
+ Sync {
// Required methods
fn RegisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn UnregisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn RevealTreeItem<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemHandle: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn RefreshTreeView<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemsToRefreshValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SetTreeViewMessage<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Message: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SetTreeViewTitle<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Title: Option<String>,
Description: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SetTreeViewBadge<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
BadgeValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetChildren<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ElementHandle: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn GetTreeItem<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ElementHandle: String,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can manage the lifecycle and data flow for custom tree views.
This trait uses a hybrid model:
- “Push” methods are called by the extension host (
Cocoon) to manage the view’s state and appearance in the main host (Mountain). - “Pull” methods are called by the main host (
Mountain) to request data from the provider in the extension host (Cocoon) on-demand (e.g., when a user expands a node).
Required Methods§
Sourcefn RegisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn RegisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Informs the host that a new tree data provider has been registered by an extension. The host should prepare to display a tree view with the given ID and options.
§Parameters
ViewIdentifier: A unique identifier for the tree view.OptionsValue: DTO containing options likeCanSelectMany.
Sourcefn UnregisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn UnregisterTreeDataProvider<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Informs the host that a tree data provider has been disposed of.
§Parameters
ViewIdentifier: The ID of the tree view to unregister.
Sourcefn RevealTreeItem<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemHandle: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn RevealTreeItem<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemHandle: String,
OptionsValue: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asks the host UI to reveal and/or expand a specific item in a tree view.
§Parameters
ViewIdentifier: The ID of the target tree view.ItemHandle: The unique handle of the item to reveal.OptionsValue: DTO specifying reveal options likeselectandfocus.
Sourcefn RefreshTreeView<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemsToRefreshValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn RefreshTreeView<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
ItemsToRefreshValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Notifies the host that some or all of the data in a tree view has changed and needs to be re-fetched and re-rendered.
§Parameters
ViewIdentifier: The ID of the tree view to refresh.ItemsToRefreshValue: Optional. IfNone, the entire tree is refreshed. IfSome, it’s a DTO representing the specific items that have changed, allowing for targeted updates.
Sourcefn SetTreeViewMessage<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Message: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SetTreeViewMessage<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Message: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets a message to be displayed in the tree view’s empty state.
§Parameters
ViewIdentifier: The ID of the target tree view.Message: An optional message to display.Noneclears the message.
Sourcefn SetTreeViewTitle<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Title: Option<String>,
Description: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SetTreeViewTitle<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
Title: Option<String>,
Description: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the title and description of the tree view container.
§Parameters
ViewIdentifier: The ID of the target tree view.Title: An optional new title for the view.Nonemight reset to default.Description: An optional description or sub-title.Noneclears it.
Sourcefn SetTreeViewBadge<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
BadgeValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SetTreeViewBadge<'life0, 'async_trait>(
&'life0 self,
ViewIdentifier: String,
BadgeValue: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets a badge (e.g., a number) on the tree view’s container icon.
§Parameters
ViewIdentifier: The ID of the target tree view.BadgeValue: A DTO for the badge, orNoneto clear it.