News for hackers. Stuff that matters.
Re:Asynchronous IO in Rust by dbaupp on Friday September 18, 2015 @01:42AM (#10237654)
There could definitely be an alternate method on `Box` that returned Result, but I don't think this is so feasible for containers which allocate in many places and so would require duplicating most of the API, however there may be some tricks that work.

https://github.com/rust-lang/rfcs/issues/538 covers the allocator stuff.

Re:Asynchronous IO in Rust by acconsta on Friday September 18, 2015 @02:13PM (#10241006)
Right, duplicating every method that allocates also isn't very elegant.

But could Box and containers be polymorphic on an OOM handling trait?

Alternatively, one could imagine an OOM-safe container that returns results, and a convenience wrapper class that unwraps them. That might harm efficient code generation though.