Found a method in #Rust #Rust!Hyper to effectively request_until:
So you can do an infinite loop with
loop_fn(acc, |x| {
x.function()
.and_then(|x| {
if x.done {
Ok(future::Loop::Break(x))
}})})
Which is fairly neat! And it solves my problem of needing to basically keep requesting data until there's no more data.
Buttttt there's a bigger problem, which is how PrestoDB sends data.
So they send data in rows at a time. Which is cool, unless you mix data types like
[1, "a"], [2, "b"], [3, "c"]
And that's not really valid in Rust. Or really most languages without lists etc. And I'm not doing a list.
So I need to transpose *during deserialization*, because that'll give me
[1, 2, 3] ["a", "b", "c"]
Which is even more problems, because that gives me 3 objects, because there are three rows, but now I'm doing it in columns I only want 2 columns of 3 values.
which is frankly kinda butts, but I've had to do worse in deserialization already?