pub struct AttemptSpec {Show 23 fields
pub attempt_id: String,
pub task: Task,
pub dag_root: String,
pub dag_path: String,
pub run: RunInfo,
pub inputs: BTreeMap<String, Value>,
pub outcomes: BTreeMap<String, Value>,
pub cancel_grace: Duration,
pub secrets: BTreeMap<SecretName, Value>,
pub mask: Mask,
pub code_dir: Option<PathBuf>,
pub script_dir: Option<PathBuf>,
pub root_copies: BTreeMap<String, PathBuf>,
pub connections: Arc<Registry>,
pub connection_env: BTreeMap<String, String>,
pub connection_test: Option<String>,
pub cleanup_handles: Option<Vec<CleanupHandle>>,
pub moved_cleanup: bool,
pub journal: Option<Journal>,
pub handle_sink: Option<HandleSink>,
pub api: Option<ApiCaller>,
pub cleanup_gate: Option<CleanupGate>,
pub trigger: Option<(TriggerStart, EventSink)>,
}Expand description
An assignment, read.
Fields§
§attempt_id: StringThe attempt’s ID.
task: TaskThe task.
dag_root: StringThe DAG root and file the task is defined in.
dag_path: StringThe file, relative to the root.
run: RunInfoThe run information.
inputs: BTreeMap<String, Value>The upstream outputs the task uses, by task ID.
outcomes: BTreeMap<String, Value>The upstream tasks’ outcomes, by task ID: a name, or null for a skipped one.
cancel_grace: DurationThe time between SIGTERM and SIGKILL when it is stopped.
secrets: BTreeMap<SecretName, Value>The secrets fetched for it, by name (AttemptSpec::needed_secrets): filled into its
templates and sent to its runner. Empty until fetched.
mask: MaskThe values masked in its output.
code_dir: Option<PathBuf>The copy of its root’s code it was planned against (decision 102); None: the
configured root.
script_dir: Option<PathBuf>For a script task, the copy of its script root’s code it was planned against; None:
the configured script root.
root_copies: BTreeMap<String, PathBuf>The copies of the other DAG roots it was planned against, on a Python task’s
sys.path in place of their configured paths (a library in another root comes from
one copy for the whole task).
connections: Arc<Registry>Its root’s connections (decision 174): rendered when the task opens one.
connection_env: BTreeMap<String, String>A command’s connections given as variables (connections={"DB": warehouse}, decision
184), by variable (DB_URL). Empty until its secrets are fetched.
connection_test: Option<String>Set for a connection test (decision 174): the runner opens and checks it, no task.
cleanup_handles: Option<Vec<CleanupHandle>>Set for a Python task’s cleanup: the attempt’s handles, for its function.
moved_cleanup: boolOnly its cleanup, moved here from a lost worker (cleanup_only).
journal: Option<Journal>The journal its handles go to; None keeps them in memory only.
handle_sink: Option<HandleSink>Told each handle, to send it on to the master; None keeps them here.
api: Option<ApiCaller>What it calls schedr’s REST API with (schedr.api, M4.11h); None: it can’t.
cleanup_gate: Option<CleanupGate>Passed between the task’s end and its cleanup, with cleanup_anywhere (decision 253).
trigger: Option<(TriggerStart, EventSink)>Set for a trigger: what it starts from, and where its events go.
Implementations§
Source§impl AttemptSpec
impl AttemptSpec
Sourcepub fn from_assign(
assign: &AssignTask,
external_inputs: Option<&[u8]>,
) -> Result<Self, InvalidAssignment>
pub fn from_assign( assign: &AssignTask, external_inputs: Option<&[u8]>, ) -> Result<Self, InvalidAssignment>
Reads an assignment; inputs are the ones fetched separately when the assignment
says they are external.
§Errors
InvalidAssignment for a task, run or inputs that don’t read (the worker rejects it
as an invalid specification).
Sourcepub fn needed_secrets(&self) -> Vec<SecretName>
pub fn needed_secrets(&self) -> Vec<SecretName>
The secrets fetched before it starts: those its references name, and those it declares (prefixes aside, read when the task asks), each once.
Sourcepub fn stand_in_secrets(&mut self)
pub fn stand_in_secrets(&mut self)
Stand-ins for the secrets it needs (a key’s "", a whole secret’s {}): planning it
before they are fetched shows whether it can run here at all.
Sourcepub fn default_timeout(
&mut self,
assign: &AssignTask,
timeouts: &WorkerTimeouts,
)
pub fn default_timeout( &mut self, assign: &AssignTask, timeouts: &WorkerTimeouts, )
Gives a resource’s cleanup without a timeout of its own the worker’s
resource_cleanup_timeout: a hung one would hold its run, which doesn’t cancel it.
Trait Implementations§
Source§impl Clone for AttemptSpec
impl Clone for AttemptSpec
Source§fn clone(&self) -> AttemptSpec
fn clone(&self) -> AttemptSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttemptSpec
impl Debug for AttemptSpec
Source§impl PartialEq for AttemptSpec
impl PartialEq for AttemptSpec
impl StructuralPartialEq for AttemptSpec
Auto Trait Implementations§
impl !RefUnwindSafe for AttemptSpec
impl !UnwindSafe for AttemptSpec
impl Freeze for AttemptSpec
impl Send for AttemptSpec
impl Sync for AttemptSpec
impl Unpin for AttemptSpec
impl UnsafeUnpin for AttemptSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);