File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,25 @@ impl Adapter {
103
103
Self { state }
104
104
}
105
105
106
+ /// Check if the adapter is currently active.
107
+ pub fn active ( & mut self ) -> bool {
108
+ match self . state {
109
+ State :: Inactive { .. } => false ,
110
+ _ => true ,
111
+ }
112
+ }
113
+
114
+ /// If the tree has been initialized, apply the given TreeUpdate. Note: If
115
+ /// the caller's implementation of [`ActivationHandler::request_initial_tree`]
116
+ /// initially returned `None`, the [`TreeUpdate`] returned by the provided function
117
+ /// must contain a full tree.
118
+ ///
119
+ /// If a [`QueuedEvents`] instance is returned, the caller must call
120
+ /// [`QueuedEvents::raise`] on it.
121
+ pub fn update ( & mut self , update : TreeUpdate ) -> Option < QueuedEvents > {
122
+ self . update_if_active ( || update)
123
+ }
124
+
106
125
/// If and only if the tree has been initialized, call the provided function
107
126
/// and apply the resulting update. Note: If the caller's implementation of
108
127
/// [`ActivationHandler::request_initial_tree`] initially returned `None`,
You can’t perform that action at this time.
0 commit comments