Struct ll::task::Task

source ·
pub struct Task(_);

Implementations

Spawn a new top level task, with no parent. This should usually be done in the very beginning of the process/application.

Get a piece of previously set data or transitive data. This can be useful if session/request tracking IDs need to be past to other loggers, e.g. when shelling out to another process that needs to set the same session_id inside so we can group the events together.

Reporters can use this flag to choose to not report errors. This is useful for cases where there’s a large task chain and every single task reports a partial errors (that gets built up with each task) It would make sense to report it only once at the top level (thrift request, cli call, etc) and only mark other tasks. If set to Some, the message inside is what would be reported by default instead of reporting errors to avoid confusion (e.g. “error was hidden, see …”) see hide_errors_default_msg()

When errors occur, we attach task data to it in the description. If set to false, only task direct data will be attached and not transitive data. This is useful sometimes to remove the noise of transitive data appearing in every error in the chain (e.g. hostname) see attach_transitive_data_to_errors_default()

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.