(function() { var type_impls = Object.fromEntries([["cosmic",[["
§

impl<T> Debug for Task<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","cosmic::app::Task"],["
§

impl<T> Default for Task<T>

§

fn default() -> Task<T>

Returns the “default value” for a type. Read more
","Default","cosmic::app::Task"],["
§

impl<T> From<()> for Task<T>

§

fn from(_value: ()) -> Task<T>

Converts to this type from the input type.
","From<()>","cosmic::app::Task"],["
§

impl<T> Task<T>

pub fn none() -> Task<T>

Creates a Task that does nothing.

\n

pub fn done(value: T) -> Task<T>
where\n T: MaybeSend + 'static,

Creates a new Task that instantly produces the given value.

\n

pub fn perform<A>(\n future: impl Future<Output = A> + MaybeSend + 'static,\n f: impl FnOnce(A) -> T + MaybeSend + 'static,\n) -> Task<T>
where\n T: MaybeSend + 'static,\n A: MaybeSend + 'static,

Creates a Task that runs the given Future to completion and maps its\noutput with the given closure.

\n

pub fn run<A>(\n stream: impl Stream<Item = A> + MaybeSend + 'static,\n f: impl Fn(A) -> T + MaybeSend + 'static,\n) -> Task<T>
where\n T: 'static,

Creates a Task that runs the given Stream to completion and maps each\nitem with the given closure.

\n

pub fn batch(tasks: impl IntoIterator<Item = Task<T>>) -> Task<T>
where\n T: 'static,

Combines the given tasks and produces a single Task that will run all of them\nin parallel.

\n

pub fn map<O>(self, f: impl FnMut(T) -> O + MaybeSend + 'static) -> Task<O>
where\n T: MaybeSend + 'static,\n O: MaybeSend + 'static,

Maps the output of a Task with the given closure.

\n

pub fn then<O>(\n self,\n f: impl FnMut(T) -> Task<O> + MaybeSend + 'static,\n) -> Task<O>
where\n T: MaybeSend + 'static,\n O: MaybeSend + 'static,

Performs a new Task for every output of the current Task using the\ngiven closure.

\n

This is the monadic interface of Task—analogous to Future and\nStream.

\n

pub fn chain(self, task: Task<T>) -> Task<T>
where\n T: 'static,

Chains a new Task to be performed once the current one finishes completely.

\n

pub fn collect(self) -> Task<Vec<T>>
where\n T: MaybeSend + 'static,

Creates a new Task that collects all the output of the current one into a Vec.

\n

pub fn discard<O>(self) -> Task<O>
where\n T: MaybeSend + 'static,\n O: MaybeSend + 'static,

Creates a new Task that discards the result of the current one.

\n

Useful if you only care about the side effects of a Task.

\n

pub fn abortable(self) -> (Task<T>, Handle)
where\n T: 'static,

Creates a new Task that can be aborted with the returned Handle.

\n

pub fn future(future: impl Future<Output = T> + MaybeSend + 'static) -> Task<T>
where\n T: 'static,

Creates a new Task that runs the given Future and produces\nits output.

\n

pub fn stream(stream: impl Stream<Item = T> + MaybeSend + 'static) -> Task<T>
where\n T: 'static,

Creates a new Task that runs the given Stream and produces\neach of its items.

\n

pub fn units(&self) -> usize

Returns the amount of work “units” of the Task.

\n
",0,"cosmic::app::Task"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() //{"start":55,"fragment_lengths":[20803]}