diff --git a/src/collection.rs b/src/collection.rs index b75881640..5e8cc4214 100644 --- a/src/collection.rs +++ b/src/collection.rs @@ -352,6 +352,17 @@ impl Collection where G::Timestamp: Da .as_collection() } + /// Brings a Collection into a nested region. + /// + /// This method is a specialization of `enter` to the case where the nested scope is a region. + /// It removes the need for an operator that adjusts the timestamp. + pub fn enter_region<'a>(&self, child: &Child<'a, G, ::Timestamp>) -> Collection::Timestamp>, D, R> + { + self.inner + .enter(child) + .as_collection() + } + /// Delays each difference by a supplied function. /// /// It is assumed that `func` only advances timestamps; this is not verified, and things may go horribly @@ -532,6 +543,19 @@ where } } +impl<'a, G: Scope, D: Data, R: Semigroup> Collection, D, R> +{ + /// Returns the value of a Collection from a nested region to its containing scope. + /// + /// This method is a specialization of `leave` to the case that of a nested region. + /// It removes the need for an operator that adjusts the timestamp. + pub fn leave_region(&self) -> Collection { + self.inner + .leave() + .as_collection() + } +} + impl Collection where G::Timestamp: Data { /// Creates a new collection whose counts are the negation of those in the input. ///