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`.",null,null],[3,"WaitScope","","A scope in which asynchronous programming can occur. Corresponds to the top level scope\nof some event loop.",null,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],[5,"new_promise_and_fulfiller","","Creates a new promise/fulfiller pair.",null,null],[5,"join_promises","","Transforms a vector of promises into a promise for a vector.",null,{"inputs":[{"name":"vec"}],"output":{"name":"promise"}}],[0,"io","","Asynchronous input and output.",null,null],[3,"Error","gj::io","",null,null],[12,"state","","",0,null],[12,"error","","",0,null],[3,"Slice","","",null,null],[12,"buf","","",1,null],[12,"end","","",1,null],[3,"MioEventPort","","",null,null],[3,"Timer","","",null,null],[0,"tcp","","",null,null],[3,"Stream","gj::io::tcp","",null,null],[3,"Listener","","",null,null],[11,"drop","","",2,null],[11,"bind","","",2,{"inputs":[{"name":"socketaddr"}],"output":{"name":"result"}}],[11,"accept","","",2,null],[11,"try_read","","",3,null],[11,"try_write","","",3,null],[11,"drop","","",3,null],[11,"connect","","",3,{"inputs":[{"name":"socketaddr"}],"output":{"name":"promise"}}],[11,"try_clone","","",3,null],[11,"try_read","","",3,null],[11,"write","","",3,null],[8,"AsyncRead","gj::io","A nonblocking input bytestream.",null,null],[10,"try_read","","Attempts to read `buf.len()` bytes from the stream, writing them into `buf`.\nReturns `self`, the modified `buf`, and the number of bytes actually read.\nReturns as soon as `min_bytes` are read or EOF is encountered.",4,null],[11,"read","","Like `try_read()`, but returns an error if EOF is encountered before `min_bytes`\ncan be read.",4,null],[8,"AsyncWrite","","A nonblocking output bytestream.",null,null],[10,"write","","Attempts to write all `buf.len()` bytes from `buf` into the stream. Returns `self` and `buf`\nonce all of the bytes have been written.",5,null],[11,"new","","",0,{"inputs":[{"name":"s"},{"name":"error"}],"output":{"name":"error"}}],[11,"into","","",0,null],[11,"into","","",0,null],[11,"new","","",1,{"inputs":[{"name":"t"},{"name":"usize"}],"output":{"name":"slice"}}],[11,"deref","","",1,null],[11,"new","","",6,{"inputs":[],"output":{"name":"result"}}],[11,"after_delay_ms","","",7,null],[11,"timeout_after_ms","","",7,null],[8,"FulfillerDropped","gj","Specifies an error to generate when a PromiseFulfiller is dropped.",null,null],[10,"fulfiller_dropped","","",8,{"inputs":[],"output":{"name":"self"}}],[8,"TaskReaper","","Callbacks to be invoked when a task in a `TaskSet` finishes. You are required to\nimplement at least the failure case.",null,null],[11,"task_succeeded","","",9,null],[10,"task_failed","","",9,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.",10,null],[11,"then","","Calls `then_else()` with a default error handler that simply propagates all errors.",10,null],[11,"map_else","","Like then_else() but for a `func` that returns a direct value rather than a promise.",10,null],[11,"map","","Calls `map_else()` with a default error handler that simple propagates all errors.",10,null],[11,"map_err","","Transforms the error branch of the promise.",10,null],[11,"lift","","Maps errors into a more general type.",10,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.",10,null],[11,"fulfilled","","Creates a new promise that has already been fulfilled.",10,{"inputs":[{"name":"t"}],"output":{"name":"promise"}}],[11,"rejected","","Creates a new promise that has already been rejected with the given error.",10,{"inputs":[{"name":"e"}],"output":{"name":"promise"}}],[11,"never_done","","Creates a new promise that never gets fulfilled.",10,{"inputs":[],"output":{"name":"promise"}}],[11,"wait","","Runs the event loop until the promise is fulfilled.",10,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.",11,{"inputs":[{"name":"f"}],"output":{"name":"result"}}],[11,"fulfill","","",12,null],[11,"reject","","",12,null],[11,"drop","","",12,null],[11,"new","","",13,{"inputs":[{"name":"box"}],"output":{"name":"taskset"}}],[11,"add","","",13,null]],"paths":[[3,"Error"],[3,"Slice"],[3,"Listener"],[3,"Stream"],[8,"AsyncRead"],[8,"AsyncWrite"],[3,"MioEventPort"],[3,"Timer"],[8,"FulfillerDropped"],[8,"TaskReaper"],[3,"Promise"],[3,"EventLoop"],[3,"PromiseFulfiller"],[3,"TaskSet"]]}; initSearch(searchIndex);