var searchIndex = {}; searchIndex["gj"] = {"doc":"A library providing high-level abstractions for event loop concurrency,\nheavily borrowing ideas from [KJ](https://capnproto.org/cxxrpc.html#kj-concurrency-framework).\nAllows for coordination of asynchronous tasks using [promises](struct.Promise.html) as\na basic building block.","items":[[3,"Promise","gj","A computation that might eventually resolve to a value of type `T` or to an error\nof type `E`. Dropping the promise cancels the computation.",null,null],[3,"WaitScope","","A scope in which asynchronous programming can occur. Corresponds to the top level scope\nof some [event loop](struct.EventLoop.html). Can be used to [wait](struct.Promise.html#method.wait)\nfor the result of a promise.",null,null],[3,"ForkedPromise","","The result of `Promise::fork()`. Allows branches to be created. Dropping the `ForkedPromise`\nalong with any branches created through `add_branch()` will cancel the computation.",null,null],[3,"ClosedEventPort","","An event port that never emits any events. On wait() it returns the error it was constructed with.",null,null],[12,"0","","",0,null],[3,"EventLoop","","A queue of events being executed in a loop on a single thread.",null,null],[3,"PromiseFulfiller","","A handle that can be used to fulfill or reject a promise. If you think of a promise\nas the receiving end of a oneshot channel, then this is the sending end.",null,null],[3,"TaskSet","","Holds a collection of `Promise<T, E>`s and ensures that each executes to completion.\nDestroying a `TaskSet` automatically cancels all of its unfinished promises.",null,null],[8,"EventPort","","Interface between an `EventLoop` and events originating from outside of the loop's thread.\nNeeded in [`Promise::wait()`](struct.Promise.html#method.wait).",null,null],[10,"wait","","Waits for an external event to arrive, blocking the thread if necessary.",1,null],[8,"FulfillerDropped","","Specifies an error to generate when a [`PromiseFulfiller`](struct.PromiseFulfiller.html) is\ndropped.",null,null],[10,"fulfiller_dropped","","",2,{"inputs":[],"output":{"name":"self"}}],[8,"TaskReaper","","Callbacks to be invoked when a task in a [`TaskSet`](struct.TaskSet.html) finishes. You are\nrequired to implement at least the failure case.",null,null],[11,"task_succeeded","","",3,null],[10,"task_failed","","",3,null],[11,"ok","","Creates a new promise that has already been fulfilled with the given value.",4,{"inputs":[{"name":"t"}],"output":{"name":"promise"}}],[11,"err","","Creates a new promise that has already been rejected with the given error.",4,{"inputs":[{"name":"e"}],"output":{"name":"promise"}}],[11,"never_done","","Creates a new promise that never resolves.",4,{"inputs":[],"output":{"name":"promise"}}],[11,"and_fulfiller","","Creates a new promise/fulfiller pair.",4,null],[11,"then_else","","Chains further computation to be executed once the promise resolves.\nWhen the promise is fulfilled or rejected, invokes `func` on its result.",4,null],[11,"then","","Calls `then_else()` with a default error handler that simply propagates all errors.",4,null],[11,"map_else","","Like `then_else()` but for a `func` that returns a direct value rather than a promise. As an\noptimization, execution of `func` is delayed until its result is known to be needed. The\nexpectation here is that `func` is just doing some transformation on the results, not\nscheduling any other actions, and therefore the system does not need to be proactive about\nevaluating it. This way, a chain of trivial `map()` transformations can be executed all at\nonce without repeated rescheduling through the event loop. Use the `eagerly_evaluate()`\nmethod to suppress this behavior.",4,null],[11,"map","","Calls `map_else()` with a default error handler that simply propagates all errors.",4,null],[11,"map_err","","Transforms the error branch of the promise.",4,null],[11,"lift","","Maps errors into a more general type.",4,null],[11,"exclusive_join","","Returns a new promise that resolves when either `self` or `other` resolves. The promise that\ndoesn't resolve first is cancelled.",4,null],[11,"all","","Transforms a collection of promises into a promise for a vector. If any of\nthe promises fails, immediately cancels the remaining promises.",4,{"inputs":[{"name":"i"}],"output":{"name":"promise"}}],[11,"fork","","Forks the promise, so that multiple different clients can independently wait on the result.",4,null],[11,"attach","","Holds onto `value` until the promise resolves, then drops `value`.",4,null],[11,"eagerly_evaluate","","Forces eager evaluation of this promise. Use this if you are going to hold on to the promise\nfor a while without consuming the result, but you want to make sure that the system actually\nprocesses it.",4,null],[11,"wait","","Runs the event loop until the promise is fulfilled.",4,null],[11,"add_branch","","Creates a new promise that will resolve when the originally forked promise resolves.",5,null],[11,"wait","","",0,null],[11,"top_level","","Creates an event loop for the current thread, panicking if one already exists. Runs the given\nclosure and then drops the event loop.",6,{"inputs":[{"name":"f"}],"output":{"name":"r"}}],[11,"fulfill","","",7,null],[11,"reject","","",7,null],[11,"resolve","","",7,null],[11,"drop","","",7,null],[11,"new","","",8,{"inputs":[{"name":"box"}],"output":{"name":"taskset"}}],[11,"add","","",8,null],[14,"pry!","","Like `try!()`, but for functions that return a [`Promise<T, E>`](struct.Promise.html) rather\nthan a `Result<T, E>`.",null,null]],"paths":[[3,"ClosedEventPort"],[8,"EventPort"],[8,"FulfillerDropped"],[8,"TaskReaper"],[3,"Promise"],[3,"ForkedPromise"],[3,"EventLoop"],[3,"PromiseFulfiller"],[3,"TaskSet"]]}; initSearch(searchIndex);