general variable
@@ -137,11 +137,15 @@ where G::Timestamp: Lattice {
impl<'a, G: Scope, D: Data, R: Diff> Variable<'a, G, D, R> where G::Timestamp: Lattice {
/// Creates a new `Variable` and a `Stream` representing its output, from a supplied `source` stream.
- pub fn from(source: Collection<Child<'a, G, u64>, D, R>) -> Variable<'a, G, D, R> {
- let (feedback, updates) = source.inner.scope().loop_variable(u64::max_value(), 1);
+ pub fn from_args(max_steps: u64, step: u64, source: Collection<Child<'a, G, u64>, D, R>) -> Variable<'a, G, D, R> {
+ let (feedback, updates) = source.inner.scope().loop_variable(max_steps, step);
let collection = Collection::new(updates).concat(&source);
Variable { collection: collection, feedback: feedback, source: source }
}
+ /// Creates a new `Variable` and a `Stream` representing its output, from a supplied `source` stream.
+ pub fn from(source: Collection<Child<'a, G, u64>, D, R>) -> Variable<'a, G, D, R> {
+ Self::from_args(u64::max_value(), 1, source)
+ }
/// Adds a new source of data to the `Variable`.
pub fn set(self, result: &Collection<Child<'a, G, u64>, D, R>) -> Collection<Child<'a, G, u64>, D, R> {
self.source.negate()
