MCPcopy Create free account
hub / github.com/NthTensor/Forte / scope_static

Function scope_static

src/scope.rs:1598–1620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1596 });
1597
1598 THREAD_POOL.depopulate();
1599 }
1600
1601 struct Tree<T: Send> {
1602 value: T,
1603 children: Vec<Tree<T>>,
1604 }
1605
1606 impl<T: Send> Tree<T> {
1607 fn iter(&self) -> vec::IntoIter<&T> {
1608 once(&self.value)
1609 .chain(self.children.iter().flat_map(Tree::iter))
1610 .collect::<Vec<_>>() // seems like it shouldn't be needed... but prevents overflow
1611 .into_iter()
1612 }
1613
1614 fn update<OP>(&mut self, op: OP)
1615 where
1616 OP: Fn(&mut T) + Sync,
1617 T: Send,
1618 {
1619 scope(|scope| self.update_in_scope(scope, &op));
1620 }
1621
1622 fn update_in_scope<'scope, 'env, OP>(
1623 &'env mut self,

Callers

nothing calls this directly

Calls 3

resize_to_availableMethod · 0.80
depopulateMethod · 0.80
spawnMethod · 0.45

Tested by

no test coverage detected