pub struct ArtifactSource {
pub receipts: Option<ReceiptsSource>,
pub test_report: Option<TestReportSource>,
pub process_snapshot: Option<ProcessSnapshotSource>,
pub run_marker: Option<RunMarkerSource>,
}Expand description
What artifact this export ships out.
Exactly-one-Option pattern, matching the rest of the typescape
(Intent, Lifetime). Adding a new artifact kind is additive on
the wire — existing JSON keeps deserializing unchanged.
Fields§
§receipts: Option<ReceiptsSource>Every ReceiptEnvelope emitted by this Process during its
lifetime — the BLAKE3-chained typed attestation stream.
test_report: Option<TestReportSource>A test report stored in a ConfigMap by an in-cluster test
runner (Job, test harness, closed-loop probe). Worker reads the
ConfigMap, packages it per format, and forwards.
process_snapshot: Option<ProcessSnapshotSource>The Process’s own ProcessSpec + ProcessStatus snapshot at
teardown time, as canonical JSON. Useful for post-mortems on
failed ephemeral runs.
run_marker: Option<RunMarkerSource>A small synthetic event — start/end of run markers, cohort
tags, experiment correlation. Worker emits a single
timestamped event with the declared labels.
Implementations§
Source§impl ArtifactSource
impl ArtifactSource
Sourcepub fn variant(&self) -> Result<ArtifactVariant<'_>, ArtifactError>
pub fn variant(&self) -> Result<ArtifactVariant<'_>, ArtifactError>
Resolve to exactly one variant. Errors on zero or many.
One-line inherent forwarder that delegates the sweep
body to the substrate primitive
crate::tagged_union::TaggedUnion::variant — every
production .variant() site on ProcessSpec dispatches
through this ONE default body so the resolve-sweep
pattern lives at ONE substrate site. The inherent surface
stays load-bearing so consumer callsites don’t need
use TaggedUnion.
Sourcepub fn has(&self, kind: ArtifactKind) -> bool
pub fn has(&self, kind: ArtifactKind) -> bool
Presence probe — does this tagged union carry a populated slot addressed by the given closed-set discriminator?
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has — every
closed-set-driven presence check on ProcessSpec
dispatches through this ONE default body so the
per-slot spec.<field>.is_some() pattern lives at
ONE substrate site. The inherent surface stays
load-bearing so consumer callsites don’t need
use TaggedUnion.
Sourcepub fn lacks(&self, kind: ArtifactKind) -> bool
pub fn lacks(&self, kind: ArtifactKind) -> bool
Closed-set-complement peer of Self::has — true iff
the given kind is MISSING (its slot on this tagged
union is empty).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::lacks, whose
default body is !self.has(kind). Every consumer whose
semantic reading is “the missing set contains this
kind” — a “still missing: lacks-<kind> require-tag classifier arm, a
dependency-satisfaction check — reads
parent.lacks(kind) through the inherent surface
rather than negating parent.has(kind) at the call
site. The definitional complement law
parent.lacks(kind) == !parent.has(kind) and the
kind-scoped implication
parent.lacks_only(kind) → parent.lacks(kind) are
pinned as first-class typed invariants by the trait’s
own default body and swept substrate-wide by
crate::tagged_union::assert_lacks_matches_has_complement.
Sourcepub fn find(&self, kind: ArtifactKind) -> Option<ArtifactVariant<'_>>
pub fn find(&self, kind: ArtifactKind) -> Option<ArtifactVariant<'_>>
Widened peer of Self::has — returns the borrowed
variant view addressed by kind, or None when the
matching slot is empty.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::find, whose
default body is kind.select(self). Every
closed-set-driven kind.select(&parent) callsite that
pre-lift required use VariantSelector at the caller
now reads parent.find(kind) through the inherent
surface, byte-for-byte symmetrical with
parent.has(kind). The composition law
parent.has(kind) == parent.find(kind).is_some() is
pinned as a first-class typed invariant by the trait’s
own has default body
(self.find(kind).is_some()), swept substrate-wide by
crate::tagged_union::assert_find_agrees_with_has.
Sourcepub fn populated_kinds(&self) -> Vec<ArtifactKind>
pub fn populated_kinds(&self) -> Vec<ArtifactKind>
Closed-set-inversion peer of Self::has / Self::find
— returns the canonical-ordered Vec of populated
ClosedSet::ALL
discriminators.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::populated_kinds,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|k| self.has(*k)).collect(). Every consumer that needs
to enumerate which slots on a tagged-union parent are
populated (an operator-facing “Ambiguous named
[Nix, Container]” diagnostic composed on the malformed
arm; a closed-set audit dispatcher; a
populated-kind-count-<n> require-tag classifier
prefix) reads parent.populated_kinds() through the
inherent surface, byte-for-byte symmetrical with
parent.has(kind) / parent.find(kind). The
composition law
parent.populated_kinds().contains(&k) == parent.has(k)
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_populated_kinds_matches_has.
Sourcepub fn iter_populated_kinds(&self) -> impl Iterator<Item = ArtifactKind> + '_
pub fn iter_populated_kinds(&self) -> impl Iterator<Item = ArtifactKind> + '_
Zero-allocation iterator peer of Self::populated_kinds
— walks
ClosedSet::ALL
in canonical order and yields every Kind whose slot on
self is populated, without materializing an
intermediate Vec.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::iter_populated_kinds,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|&k| self.has(k)).
Consumers reach for the iterator peer when they need
a short-circuiting fold (.any(|k| pred(k)),
.find(|&k| pred(k)), .take_while(|k| pred(k))) or
a projection (.map(|k| project(k))) that would
otherwise pay for the heap allocation the Vec-widened
Self::populated_kinds peer materializes. The
composition law
parent.populated_kinds() == parent.iter_populated_kinds().collect::<Vec<_>>()
is pinned as a first-class typed invariant by the
trait’s own default body (which IS iter_populated_kinds().collect())
and swept substrate-wide by
crate::tagged_union::assert_iter_populated_kinds_matches_populated_kinds.
Sourcepub fn populated_kind_count(&self) -> usize
pub fn populated_kind_count(&self) -> usize
Scalar cardinality peer of Self::populated_kinds —
the number of populated slots on this tagged union.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::populated_kind_count,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|k| self.has(*k)).count(). Every consumer that needs the
cardinality of the populated-slot set as a scalar
(a populated-kind-count-<n> require-tag classifier
prefix; a fast-path branch on the Ambiguous-arm side
that discriminates “well-formed” from “malformed with
N slots”; a coherence check that verifies “every
well-formed parent has exactly one populated slot”)
reads parent.populated_kind_count() through the
inherent surface, byte-for-byte symmetrical with
parent.has(kind) / parent.find(kind) /
parent.populated_kinds(). The composition law
parent.populated_kind_count() == parent.populated_kinds().len()
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_populated_kind_count_matches_populated_kinds.
Sourcepub fn missing_kinds(&self) -> Vec<ArtifactKind>
pub fn missing_kinds(&self) -> Vec<ArtifactKind>
Closed-set-COMPLEMENT peer of Self::populated_kinds
— returns the canonical-ordered Vec of EMPTY
ClosedSet::ALL
discriminators.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::missing_kinds,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|k| !self.has(*k)).collect(). Every consumer that needs to
enumerate which slots on a tagged-union parent are
ABSENT (an operator-facing “still missing [Nix, Container]”
diagnostic on the partially-populated arm; a coherence
check verifying “every process boundary carries every
intent slot”; a missing-<kind> require-tag classifier
arm) reads parent.missing_kinds() through the
inherent surface, byte-for-byte symmetrical with
parent.populated_kinds(). The partition law
parent.populated_kinds() ∪ parent.missing_kinds() == ClosedSet::ALL (with the two sets disjoint) is pinned
as a first-class typed invariant by the trait’s own
default body and swept substrate-wide by
crate::tagged_union::assert_missing_kinds_matches_has.
Sourcepub fn iter_missing_kinds(&self) -> impl Iterator<Item = ArtifactKind> + '_
pub fn iter_missing_kinds(&self) -> impl Iterator<Item = ArtifactKind> + '_
Zero-allocation iterator peer of Self::missing_kinds
— walks
ClosedSet::ALL
in canonical order and yields every Kind whose slot on
self is EMPTY, without materializing an intermediate
Vec.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::iter_missing_kinds,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|&k| !self.has(k)).
Consumers reach for the iterator peer when they need
a short-circuiting fold under negation
(.any(|k| pred(k)), .find(|&k| pred(k)),
.take_while(|k| pred(k))) or a projection (.map(|k| project(k))) that would otherwise pay for the heap
allocation the Vec-widened Self::missing_kinds peer
materializes. The composition law
parent.missing_kinds() == parent.iter_missing_kinds().collect::<Vec<_>>()
is pinned as a first-class typed invariant by the
trait’s own default body (which IS
iter_missing_kinds().collect()) and swept substrate-
wide by
crate::tagged_union::assert_iter_missing_kinds_matches_missing_kinds.
Sourcepub fn missing_kind_count(&self) -> usize
pub fn missing_kind_count(&self) -> usize
Scalar cardinality peer of Self::missing_kinds —
the number of EMPTY slots on this tagged union.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::missing_kind_count,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().filter(|k| !self.has(*k)).count(). Every consumer that needs the
cardinality of the missing-slot set as a scalar (a
missing-kind-count-<n> require-tag classifier prefix;
a fast-path branch that discriminates “well-formed”
from “N missing slots”; a coherence check that verifies
“every well-formed parent has exactly ALL.len() - 1
missing slots”) reads parent.missing_kind_count()
through the inherent surface, byte-for-byte symmetrical
with parent.populated_kind_count(). The scalar
partition law parent.populated_kind_count() + parent.missing_kind_count() == <Kind as ClosedSet>::ALL.len()
is pinned by the trait’s own default body and swept
substrate-wide by
crate::tagged_union::assert_missing_kind_count_matches_missing_kinds.
Sourcepub fn first_populated_kind(&self) -> Option<ArtifactKind>
pub fn first_populated_kind(&self) -> Option<ArtifactKind>
Short-circuiting Option<$kind> peer of
Self::populated_kinds — the FIRST populated kind on
this tagged union in canonical
ClosedSet::ALL
order, or None when no slot is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::first_populated_kind,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().find(|k| self.has(*k)). Every consumer that needs the earliest
populated slot on a tagged-union parent as an
Option<Kind> (an operator-facing “Ambiguous, starting
at Nix” diagnostic on the malformed arm; a
first-populated-<kind> require-tag classifier arm; a
fast-path branch that discriminates “empty” from “any
populated”) reads parent.first_populated_kind() through
the inherent surface, byte-for-byte symmetrical with
parent.populated_kinds() / parent.has(kind). The
composition law parent.first_populated_kind() == parent.populated_kinds().first().copied() is pinned as
a first-class typed invariant by the trait’s own default
body and swept substrate-wide by
crate::tagged_union::assert_first_populated_kind_matches_populated_kinds.
Sourcepub fn first_missing_kind(&self) -> Option<ArtifactKind>
pub fn first_missing_kind(&self) -> Option<ArtifactKind>
Short-circuiting Option<$kind> peer of
Self::missing_kinds — the FIRST missing kind on this
tagged union in canonical
ClosedSet::ALL
order, or None when EVERY slot is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::first_missing_kind,
whose default body is
<Kind as ClosedSet>::ALL.iter().copied().find(|k| !self.has(*k)). Byte-for-byte symmetrical with
parent.first_populated_kind() under a negated
predicate; the two primitives PARTITION
ClosedSet::ALL’s earliest-element projection on the
(populated, missing) split. The composition law
parent.first_missing_kind() == parent.missing_kinds().first().copied() is pinned as a
first-class typed invariant by the trait’s own default
body and swept substrate-wide by
crate::tagged_union::assert_first_missing_kind_matches_missing_kinds.
Sourcepub fn last_populated_kind(&self) -> Option<ArtifactKind>
pub fn last_populated_kind(&self) -> Option<ArtifactKind>
Short-circuiting Option<$kind> peer of
Self::populated_kinds — the LAST populated kind on
this tagged union in canonical
ClosedSet::ALL
order, or None when no slot is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::last_populated_kind,
whose default body is
<Kind as ClosedSet>::ALL.iter().rev().copied().find(|k| self.has(*k)) — a REVERSED closed-set walk composed
against self.has per variant that SHORT-CIRCUITS at
the latest match. Byte-for-byte time-reversed peer of
Self::first_populated_kind. Empty parent returns
None; well-formed parent returns Some(k) (the sole
populated slot); malformed (Ambiguous) parent returns
Some(k) where k is the LATEST populated slot in
canonical ALL order — the operator-diagnostic “and
last at Z” peer of the “Ambiguous, starting at Nix”
upgrade the first-projection enables. The composition
law parent.last_populated_kind() == parent.populated_kinds().last().copied() is pinned as
a first-class typed invariant by the trait’s own default
body and swept substrate-wide by
crate::tagged_union::assert_last_populated_kind_matches_populated_kinds.
Sourcepub fn last_missing_kind(&self) -> Option<ArtifactKind>
pub fn last_missing_kind(&self) -> Option<ArtifactKind>
Short-circuiting Option<$kind> peer of
Self::missing_kinds — the LAST missing kind on this
tagged union in canonical
ClosedSet::ALL
order, or None when EVERY slot is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::last_missing_kind,
whose default body is
<Kind as ClosedSet>::ALL.iter().rev().copied().find(|k| !self.has(*k)). Byte-for-byte time-reversed peer of
Self::first_missing_kind under an identical negated
predicate. The two primitives PARTITION
ClosedSet::ALL’s endpoint projection on the (populated,
missing) × (earliest, latest) product together with the
first_* peers — every endpoint-addressable coherence
check reads ONE of the four at ONE call site without
allocating a Vec<$kind>. The composition law
parent.last_missing_kind() == parent.missing_kinds().last().copied() is pinned as a
first-class typed invariant by the trait’s own default
body and swept substrate-wide by
crate::tagged_union::assert_last_missing_kind_matches_missing_kinds.
Sourcepub fn unique_populated_kind(&self) -> Option<ArtifactKind>
pub fn unique_populated_kind(&self) -> Option<ArtifactKind>
Exactly-one-populated Option<$kind> peer of
Self::populated_kinds — Some(k) iff k is the
SOLE populated kind on this tagged union, else None.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::unique_populated_kind,
whose default body is a two-step-short-circuit walk
over <Kind as ClosedSet>::ALL returning Some(k)
only when EXACTLY ONE has(k) is true. Every
consumer that needs the resolved kind identity on the
well-formed arm (without paying for the borrowed
variant view Self::variant returns, and without
materializing the [Self::Error] carrier on the
empty / malformed arms) reads
parent.unique_populated_kind() through the inherent
surface — Some(k) names well-formed exactly-one,
None collapses BOTH the empty AND the malformed
(ambiguous) arms.
The composition laws
parent.unique_populated_kind().is_some() == (parent.populated_kind_count() == 1) and (on the
Some arm) parent.unique_populated_kind() == parent.first_populated_kind() == parent.last_populated_kind() are pinned as first-
class typed invariants by the trait’s own default body
and swept substrate-wide by
crate::tagged_union::assert_unique_populated_kind_matches_populated_kinds.
Sourcepub fn unique_missing_kind(&self) -> Option<ArtifactKind>
pub fn unique_missing_kind(&self) -> Option<ArtifactKind>
Exactly-one-missing Option<$kind> peer of
Self::missing_kinds — Some(k) iff k is the
SOLE missing kind on this tagged union, else None.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::unique_missing_kind,
whose default body is a two-step-short-circuit walk
over <Kind as ClosedSet>::ALL under a NEGATED has
predicate returning Some(k) only when EXACTLY ONE
!has(k) is true. Byte-for-byte symmetrical with
parent.unique_populated_kind() under complement; on
tagged unions with <Kind as ClosedSet>::ALL.len() > 2 the primitive returns Some only on the near-
saturation arm (ALL.len() - 1 populated).
The composition laws
parent.unique_missing_kind().is_some() == (parent.missing_kind_count() == 1) and (on the
Some arm) parent.unique_missing_kind() == parent.first_missing_kind() == parent.last_missing_kind() are pinned as first-class
typed invariants by the trait’s own default body and
swept substrate-wide by
crate::tagged_union::assert_unique_missing_kind_matches_missing_kinds.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Boolean cardinality-endpoint peer of Self::populated_kinds
— true iff NO slot on this tagged union is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::is_empty, whose
default body is !<Kind as ClosedSet>::ALL.iter().any(|k| self.has(k)) — a short-circuiting closed-set walk that
returns true iff every point-probe returns false,
WITHOUT materializing the Vec populated_kinds would
build. Every consumer that needs the zero-arm Boolean
projection of the populated cardinality (a fast-path
guard on “any content at all”; an operator-facing
“carrier missing content” diagnostic on the Empty arm;
an is-empty require-tag classifier arm) reads
parent.is_empty() through the inherent surface, byte-
for-byte symmetrical with parent.is_saturated() under
the (populated, missing) complement axis. The
composition law
parent.is_empty() == (parent.populated_kind_count() == 0)
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_is_empty_matches_populated_kind_count.
Sourcepub fn is_saturated(&self) -> bool
pub fn is_saturated(&self) -> bool
Boolean cardinality-endpoint peer of Self::missing_kinds
— true iff EVERY slot on this tagged union is populated
(i.e. the missing set is empty).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::is_saturated, whose
default body is <Kind as ClosedSet>::ALL.iter().all(|k| self.has(k)) — a short-circuiting closed-set walk that
returns true iff every point-probe returns true,
WITHOUT materializing the Vec missing_kinds would
build. Every consumer that needs the zero-arm Boolean
projection of the missing cardinality (a fast-path guard
discriminating “over-populated” from “well-formed or
partial”; an operator-facing “over-populated carrier”
diagnostic; an is-saturated require-tag classifier
arm) reads parent.is_saturated() through the inherent
surface, byte-for-byte symmetrical with
parent.is_empty() under the (populated, missing)
complement axis. The composition law
parent.is_saturated() == (parent.missing_kind_count() == 0)
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_is_saturated_matches_missing_kind_count.
Sourcepub fn has_any_populated_kind(&self) -> bool
pub fn has_any_populated_kind(&self) -> bool
Boolean cardinality “at-least-one” peer of
Self::populated_kinds — true iff AT LEAST ONE slot
on this tagged union is populated (the populated set is
NON-empty).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_any_populated_kind,
whose default body is <Kind as ClosedSet>::ALL.iter().any(|k| self.has(k)) — a short-circuiting closed-set walk that
returns true at the FIRST populated slot, WITHOUT
materializing the Vec populated_kinds would build.
Every consumer that needs the ≥ 1 halfspace on the
populated cardinality (a boundary-progress “any content
at all” diagnostic; an is-non-empty require-tag
classifier arm; a fast-path branch discriminating “some
populated” from “all missing”) reads
parent.has_any_populated_kind() through the inherent
surface — byte-for-byte definitional complement of
parent.is_empty(), no readerly inversion at the
callsite, and byte-for-byte symmetrical with
parent.has_any_missing_kind() under the (populated,
missing) complement axis. The composition law
parent.has_any_populated_kind() == !parent.is_empty()
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_has_any_populated_kind_matches_populated_kind_count.
Sourcepub fn has_any_missing_kind(&self) -> bool
pub fn has_any_missing_kind(&self) -> bool
Boolean cardinality “at-least-one” peer of
Self::missing_kinds — true iff AT LEAST ONE slot on
this tagged union is missing (the missing set is
NON-empty).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_any_missing_kind,
whose default body is <Kind as ClosedSet>::ALL.iter().any(|k| !self.has(k)) — a short-circuiting closed-set walk under
a negated has predicate that returns true at the
FIRST missing slot, WITHOUT materializing the Vec
missing_kinds would build. Every consumer that needs
the ≥ 1 halfspace on the missing cardinality (an
operator-facing “not fully populated” diagnostic; a
has-any-missing-kind require-tag classifier arm; a
fast-path branch discriminating “any slot still absent”
from “over-populated / saturated”) reads
parent.has_any_missing_kind() through the inherent
surface — byte-for-byte definitional complement of
parent.is_saturated(), no readerly inversion at the
callsite, and byte-for-byte symmetrical with
parent.has_any_populated_kind() under the (populated,
missing) complement axis. The composition law
parent.has_any_missing_kind() == !parent.is_saturated()
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_has_any_missing_kind_matches_missing_kind_count.
Sourcepub fn has_unique_populated_kind(&self) -> bool
pub fn has_unique_populated_kind(&self) -> bool
Boolean cardinality-mid-endpoint peer of
Self::unique_populated_kind — true iff EXACTLY ONE
slot on this tagged union is populated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_unique_populated_kind,
whose default body is self.unique_populated_kind().is_some()
— the Boolean projection of the two-step-short-circuit
closed-set walk unique_populated_kind already performs,
without paying for a Vec<$kind> allocation on any arm.
Every consumer that needs the exactly-one-populated arm
as a bool (a fast-path branch on the well-formed arm
that skips the borrowed-view / error-carrier
materialization Self::variant would pay for; an
operator-facing “well-formed” diagnostic on the resolver’s
Ok arm; a has-unique-populated-kind require-tag
classifier arm; a coherence check verifying “every
production parent from a single_slot_X factory is
well-formed”) reads parent.has_unique_populated_kind()
through the inherent surface, byte-for-byte symmetrical
with parent.is_empty() / parent.is_saturated() under
the (zero-, one-arm) × (populated, missing) cardinality
grid. The composition law
parent.has_unique_populated_kind() == (parent.populated_kind_count() == 1)
is pinned as a first-class typed invariant by the trait’s
own default body and swept substrate-wide by
crate::tagged_union::assert_has_unique_populated_kind_matches_populated_kind_count.
Sourcepub fn has_unique_missing_kind(&self) -> bool
pub fn has_unique_missing_kind(&self) -> bool
Boolean cardinality-mid-endpoint peer of
Self::unique_missing_kind — true iff EXACTLY ONE
slot on this tagged union is missing.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_unique_missing_kind,
whose default body is self.unique_missing_kind().is_some()
— the Boolean projection of the two-step-short-circuit
closed-set walk unique_missing_kind already performs.
Every consumer that needs the exactly-one-missing arm as
a bool (a fast-path branch on the near-saturation arm;
an operator-facing “one slot away from saturated”
diagnostic; a has-unique-missing-kind require-tag
classifier arm) reads parent.has_unique_missing_kind()
through the inherent surface, byte-for-byte symmetrical
with parent.has_unique_populated_kind() under the
(populated, missing) complement axis. The composition law
parent.has_unique_missing_kind() == (parent.missing_kind_count() == 1)
is pinned as a first-class typed invariant by the trait’s
own default body and swept substrate-wide by
crate::tagged_union::assert_has_unique_missing_kind_matches_missing_kind_count.
Sourcepub fn has_multiple_populated_kinds(&self) -> bool
pub fn has_multiple_populated_kinds(&self) -> bool
Boolean cardinality many-arm peer of
Self::has_unique_populated_kind — true iff TWO
OR MORE slots on this tagged union are populated (i.e.
the “ambiguous” arm of the resolver contract).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_multiple_populated_kinds,
whose default body is a two-step-short-circuit closed-
set walk under Self::has that returns true iff
the filtered iterator yields at least two hits, WITHOUT
materializing the Vec populated_kinds would build.
The short-circuit fires on the SECOND populated slot
— strictly cheaper than the widened primitive on every
arm past the second populated slot.
§Sibling to the Boolean cardinality trichotomy
Third arm of the {0, 1, ≥2} cardinality trichotomy on
the populated axis. Together with Self::is_empty
(zero-arm) and Self::has_unique_populated_kind
(one-arm), these three Boolean primitives partition
every tagged-union state coherently — EXACTLY ONE of
the three returns true on any given parent. Maps
directly onto the three arms of the resolver contract
Self::variant returns:
is_empty() ↔ Err(Error::empty),
has_unique_populated_kind() ↔ Ok(Variant),
has_multiple_populated_kinds() ↔ Err(Error::ambiguous).
The composition law
parent.has_multiple_populated_kinds() == (parent.populated_kind_count() >= 2)
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_has_multiple_populated_kinds_matches_populated_kind_count.
Sourcepub fn has_multiple_missing_kinds(&self) -> bool
pub fn has_multiple_missing_kinds(&self) -> bool
Boolean cardinality many-arm peer of
Self::has_unique_missing_kind — true iff TWO OR
MORE slots on this tagged union are missing.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_multiple_missing_kinds,
whose default body is a two-step-short-circuit closed-
set walk under a NEGATED Self::has predicate that
returns true iff the filtered iterator yields at
least two hits, WITHOUT materializing the Vec
missing_kinds would build. Byte-for-byte symmetrical
with parent.has_multiple_populated_kinds() under the
(populated, missing) complement axis.
Third arm of the {0, 1, ≥2} cardinality trichotomy on
the missing axis. Together with Self::is_saturated
(zero-arm) and Self::has_unique_missing_kind
(one-arm), these three Boolean primitives partition
every tagged-union state coherently on the complement
axis. The composition law
parent.has_multiple_missing_kinds() == (parent.missing_kind_count() >= 2)
is pinned as a first-class typed invariant by the
trait’s own default body and swept substrate-wide by
crate::tagged_union::assert_has_multiple_missing_kinds_matches_missing_kind_count.
Sourcepub fn has_at_most_one_populated_kind(&self) -> bool
pub fn has_at_most_one_populated_kind(&self) -> bool
Boolean cardinality “≤ 1” peer of
Self::has_multiple_populated_kinds — true iff AT
MOST ONE slot on this tagged union is populated (i.e.
zero or one populated slot).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_at_most_one_populated_kind,
whose default body is the definitional Boolean negation
of Self::has_multiple_populated_kinds — reuses the
SAME two-step-short-circuit closed-set walk without
re-authoring the fused loop; the short-circuit fires on
the SECOND populated slot, and the negation flips the
return in-place without a second walk over the closed
set. Strictly cheaper than the widened union composition
self.is_empty() || self.has_unique_populated_kind()
(which walks the closed set twice) on every arm.
§Sibling to the Boolean cardinality “≥ 2” primitive
Boolean-negation peer under !(≥ 2) == (≤ 1) — where
Self::has_multiple_populated_kinds names the
AMBIGUOUS arm of the resolver contract (the arm
Self::variant returns Err(Error::ambiguous) on),
has_at_most_one_populated_kind names its complement —
the RESOLVEABLE-OR-EMPTY arm (the two arms of the
resolver contract that DON’T return Err(Error::ambiguous)).
The typed predicate for “this parent is not ambiguous”
without inverting a !parent.has_multiple_populated_kinds()
at every callsite.
§Composition laws
has_at_most_one_populated_kind() == !has_multiple_populated_kinds()— the definitional Boolean negation, at the trait default body’s SAME fused short-circuit walk.has_at_most_one_populated_kind() == (populated_kind_count() <= 1)— the scalar cardinality composition.has_at_most_one_populated_kind() == is_empty() || has_unique_populated_kind()— the union of the zero-arm and the one-arm of the {0, 1, ≥ 2} cardinality trichotomy.
All three composition laws are pinned as first-class
typed invariants by the trait’s own default body and
swept substrate-wide by
crate::tagged_union::assert_has_at_most_one_populated_kind_matches_populated_kind_count.
Sourcepub fn has_at_most_one_missing_kind(&self) -> bool
pub fn has_at_most_one_missing_kind(&self) -> bool
Boolean cardinality “≤ 1” peer of
Self::has_multiple_missing_kinds — true iff AT
MOST ONE slot on this tagged union is missing (i.e.
zero or one missing slot).
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_at_most_one_missing_kind,
whose default body is the definitional Boolean negation
of Self::has_multiple_missing_kinds — reuses the
SAME two-step-short-circuit closed-set walk under a
negated Self::has predicate without re-authoring the
fused loop. Strictly cheaper than the widened union
composition
self.is_saturated() || self.has_unique_missing_kind()
(two closed-set walks) on every arm.
§Sibling to the Boolean cardinality “≥ 2” primitive
Boolean-negation peer under !(≥ 2) == (≤ 1) —
byte-for-byte symmetrical with
parent.has_at_most_one_populated_kind() under the
(populated, missing) complement axis. Names the arm
where the parent is SATURATED-OR-NEAR-SATURATED (zero
or exactly one missing slot).
§Composition laws
has_at_most_one_missing_kind() == !has_multiple_missing_kinds()— the definitional Boolean negation.has_at_most_one_missing_kind() == (missing_kind_count() <= 1)— the scalar complement-cardinality composition.has_at_most_one_missing_kind() == is_saturated() || has_unique_missing_kind()— the union of the zero-missing-arm and the one-missing-arm of the {0, 1, ≥ 2} cardinality trichotomy on the missing axis.
All three composition laws are pinned as first-class
typed invariants by the trait’s own default body and
swept substrate-wide by
crate::tagged_union::assert_has_at_most_one_missing_kind_matches_missing_kind_count.
Sourcepub fn is_partially_populated(&self) -> bool
pub fn is_partially_populated(&self) -> bool
Boolean parent-state middle-arm projection — true iff
this tagged union has AT LEAST ONE populated slot AND AT
LEAST ONE missing slot, i.e. it is neither
Self::is_empty nor Self::is_saturated.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::is_partially_populated,
whose default body is a FUSED short-circuit closed-set
walk that returns true at the EARLIEST slot where both
a populated AND a missing kind have been observed —
byte-for-byte cheaper than the widened composition
!self.is_empty() && !self.is_saturated() (two closed-
set walks) on every partially-populated arm.
§Sibling to the parent-state trichotomy
Middle arm of the natural {Empty | Partial | Saturated}
parent-state trichotomy — orthogonal to the {0, 1, ≥2}
cardinality trichotomies on the populated / missing
axes. Together with Self::is_empty (all-missing arm)
and Self::is_saturated (all-populated arm), these
three Boolean primitives partition every tagged-union
state coherently on the parent-state axis — EXACTLY ONE
of the three returns true on any given parent. The
trichotomy partition law
`usize::from(is_empty()) + usize::from(is_partially_populated())
- usize::from(is_saturated()) == 1
is pinned as a first- class typed invariant by the trait's own default body and swept substrate-wide by [crate::tagged_union::assert_is_partially_populated_matches_cardinality`].
Sourcepub fn has_only(&self, kind: ArtifactKind) -> bool
pub fn has_only(&self, kind: ArtifactKind) -> bool
Kind-scoped strict refinement of Self::has — true
iff the given kind is populated AND no OTHER slot on
this tagged union is populated. The “exactly this one
variant” predicate.
One-line inherent forwarder that delegates to the
substrate primitive
crate::tagged_union::TaggedUnion::has_only, whose
default body is a FUSED short-circuit closed-set walk
that returns false at the EARLIEST populated slot
whose kind is NOT kind, and returns true iff the
sweep completes with kind seen as the sole populated
slot. Byte-for-byte cheaper than either widened
composition self.unique_populated_kind() == Some(kind) (which walks until the SECOND populated
slot) or self.has(kind) && self.has_unique_populated_kind() (which walks the
closed set twice) on every arm where the parent
carries a populated slot that isn’t kind.
§Sibling to Self::has
Kind-scoped strict-refinement peer: has(kind) is the
SUBSET predicate; has_only(kind) is the EQUAL
predicate. The implication
has_only(kind) → has(kind) binds the pair on the
strict-refinement axis. The composition law
parent.has_only(kind) == (parent.unique_populated_kind() == Some(kind)) is
pinned as a first-class typed invariant by the trait’s
own default body and swept substrate-wide by
crate::tagged_union::assert_has_only_matches_unique_populated_kind.
Sourcepub fn lacks_only(&self, kind: ArtifactKind) -> bool
pub fn lacks_only(&self, kind: ArtifactKind) -> bool
Closed-set-complement peer of Self::has_only —
true iff the given kind is MISSING AND no OTHER slot
on this tagged union is missing.
One-line inherent forwarder that delegates the fused
short-circuit walk to the substrate primitive
crate::tagged_union::TaggedUnion::lacks_only, whose
default body walks
<Self::Kind as ClosedSet>::ALL under a negated
crate::tagged_union::TaggedUnion::has and returns
false at the EARLIEST missing slot whose kind is not
kind. Byte-for-byte cheaper than either widened
composition
self.unique_missing_kind() == Some(kind) (which walks
until the SECOND missing slot before comparing) or
!self.has(kind) && self.has_unique_missing_kind()
(two closed-set walks) on every arm where the parent
carries a missing slot that isn’t kind.
§Sibling to Self::has_only
Closed-set-complement peer: has_only(kind) names
parents whose SOLE populated slot is kind;
lacks_only(kind) names parents whose SOLE missing slot
is kind. The composition law
parent.lacks_only(kind) == (parent.unique_missing_kind() == Some(kind)) and the
cardinality-refinement law
parent.lacks_only(kind) == (!parent.has(kind) && parent.has_unique_missing_kind()) are pinned as first-
class typed invariants by the trait’s own default body
and swept substrate-wide by
crate::tagged_union::assert_lacks_only_matches_unique_missing_kind.
Trait Implementations§
Source§impl Clone for ArtifactSource
impl Clone for ArtifactSource
Source§impl Debug for ArtifactSource
impl Debug for ArtifactSource
Source§impl Default for ArtifactSource
impl Default for ArtifactSource
Source§impl<'de> Deserialize<'de> for ArtifactSource
impl<'de> Deserialize<'de> for ArtifactSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ArtifactSource
impl JsonSchema for ArtifactSource
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Serialize for ArtifactSource
impl Serialize for ArtifactSource
Source§impl TaggedUnion for ArtifactSource
impl TaggedUnion for ArtifactSource
Source§const KIND_LIST: &'static str = ARTIFACT_KIND_LIST
const KIND_LIST: &'static str = ARTIFACT_KIND_LIST
TaggedUnionError::empty when no slot is populated on this
tagged union. Pinned against
<Self::Kind as tatara_closed_set::ClosedSet>::labels_joined("/")
by assert_kind_list_matches_closed_set so a variant added
to Self::Kind without updating this constant (or a renamed
variant) fails-loudly at the testkit boundary.Source§type Kind = ArtifactKind
type Kind = ArtifactKind
tatara_closed_set::ClosedSet so the generic
diagnostic-stability testkit (assert_kind_list_matches_closed_set)
can project <Self::Kind as ClosedSet>::labels_joined("/")
against Self::KIND_LIST byte-identically. Additionally
bound to VariantSelector<Self> so Self::variant’s
default body can dispatch k.select(self) at each
[ClosedSet::ALL] entry generically.Source§type Error = ArtifactError
type Error = ArtifactError
.variant() method — projects onto the shared
TaggedUnionError contract so resolve_or_err’s two-arm
dispatch reaches every implementor uniformly.Source§fn variant(
&self,
) -> Result<<Self::Kind as VariantSelector<Self>>::Variant<'_>, Self::Error>
fn variant( &self, ) -> Result<<Self::Kind as VariantSelector<Self>>::Variant<'_>, Self::Error>
Self::Kind discriminator in
ClosedSet::ALL order,
projecting each into the parent’s borrowed variant view via
VariantSelector::select, and resolve to exactly one populated
variant through resolve_or_err. Errors on zero (with
Self::KIND_LIST carried on the TaggedUnionError::empty
arm) or many. Read moreSource§fn find(
&self,
kind: Self::Kind,
) -> Option<<Self::Kind as VariantSelector<Self>>::Variant<'_>>
fn find( &self, kind: Self::Kind, ) -> Option<<Self::Kind as VariantSelector<Self>>::Variant<'_>>
Source§fn has(&self, kind: Self::Kind) -> bool
fn has(&self, kind: Self::Kind) -> bool
Source§fn populated_kinds(&self) -> Vec<Self::Kind>
fn populated_kinds(&self) -> Vec<Self::Kind>
Self::Kind discriminators whose corresponding slot on
self is populated, in canonical
ClosedSet::ALL order. Read moreSource§fn iter_populated_kinds(&self) -> impl Iterator<Item = Self::Kind> + '_
fn iter_populated_kinds(&self) -> impl Iterator<Item = Self::Kind> + '_
Self::populated_kinds —
walk ClosedSet::ALL in
canonical order and yield every Kind whose corresponding slot
on self is populated, WITHOUT materializing an intermediate
Vec. Read moreSource§fn populated_kind_count(&self) -> usize
fn populated_kind_count(&self) -> usize
Self::Kind discriminators whose corresponding
slot on self is populated. Read moreSource§fn missing_kinds(&self) -> Vec<Self::Kind>
fn missing_kinds(&self) -> Vec<Self::Kind>
Self::Kind discriminators whose corresponding slot on
self is EMPTY, in canonical
ClosedSet::ALL order. Read moreSource§fn iter_missing_kinds(&self) -> impl Iterator<Item = Self::Kind> + '_
fn iter_missing_kinds(&self) -> impl Iterator<Item = Self::Kind> + '_
Self::missing_kinds —
walk ClosedSet::ALL in
canonical order and yield every Kind whose corresponding slot
on self is EMPTY, WITHOUT materializing an intermediate
Vec. Read moreSource§fn missing_kind_count(&self) -> usize
fn missing_kind_count(&self) -> usize
Self::Kind discriminators whose corresponding
slot on self is EMPTY. Read moreSource§fn first_populated_kind(&self) -> Option<Self::Kind>
fn first_populated_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::populated_kinds — the FIRST populated kind on this
tagged union in canonical
ClosedSet::ALL order, or
None when no slot is populated. Read moreSource§fn first_missing_kind(&self) -> Option<Self::Kind>
fn first_missing_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::missing_kinds — the FIRST missing kind on this tagged
union in canonical
ClosedSet::ALL order, or
None when EVERY slot is populated. Read moreSource§fn last_populated_kind(&self) -> Option<Self::Kind>
fn last_populated_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::populated_kinds — the LAST populated kind on this
tagged union in canonical
ClosedSet::ALL order, or
None when no slot is populated. Read moreSource§fn last_missing_kind(&self) -> Option<Self::Kind>
fn last_missing_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::missing_kinds — the LAST missing kind on this tagged
union in canonical
ClosedSet::ALL order, or
None when EVERY slot is populated. Read moreSource§fn unique_populated_kind(&self) -> Option<Self::Kind>
fn unique_populated_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::populated_kinds — Some(k) iff k is the SOLE
populated kind on this tagged union, else None. Read moreSource§fn unique_missing_kind(&self) -> Option<Self::Kind>
fn unique_missing_kind(&self) -> Option<Self::Kind>
Option<Self::Kind> peer of
Self::missing_kinds — Some(k) iff k is the SOLE missing
kind on this tagged union, else None. Read moreSource§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Self::populated_kinds —
true iff NO slot on this tagged union is populated. Read moreSource§fn is_saturated(&self) -> bool
fn is_saturated(&self) -> bool
Self::missing_kinds —
true iff EVERY slot on this tagged union is populated (i.e.
the missing set is empty). Read moreSource§fn has_any_populated_kind(&self) -> bool
fn has_any_populated_kind(&self) -> bool
Self::populated_kinds — true iff AT LEAST ONE slot on this
tagged union is populated (i.e. the populated set is NON-empty). Read moreSource§fn has_any_missing_kind(&self) -> bool
fn has_any_missing_kind(&self) -> bool
Self::missing_kinds
— true iff AT LEAST ONE slot on this tagged union is missing
(i.e. the missing set is NON-empty). Read moreSource§fn has_unique_populated_kind(&self) -> bool
fn has_unique_populated_kind(&self) -> bool
Self::unique_populated_kind — true iff EXACTLY ONE slot on
this tagged union is populated. Read moreSource§fn has_unique_missing_kind(&self) -> bool
fn has_unique_missing_kind(&self) -> bool
Self::unique_missing_kind — true iff EXACTLY ONE slot on
this tagged union is missing. Read moreSource§fn has_multiple_populated_kinds(&self) -> bool
fn has_multiple_populated_kinds(&self) -> bool
Self::has_unique_populated_kind — true iff TWO OR MORE
slots on this tagged union are populated. Read moreSource§fn has_multiple_missing_kinds(&self) -> bool
fn has_multiple_missing_kinds(&self) -> bool
Self::has_unique_missing_kind — true iff TWO OR MORE
slots on this tagged union are missing. Read moreSource§fn has_at_most_one_populated_kind(&self) -> bool
fn has_at_most_one_populated_kind(&self) -> bool
Self::has_multiple_populated_kinds — true iff AT MOST ONE
slot on this tagged union is populated (i.e. zero or one
populated slot). Read moreSource§fn has_at_most_one_missing_kind(&self) -> bool
fn has_at_most_one_missing_kind(&self) -> bool
Self::has_multiple_missing_kinds — true iff AT MOST ONE
slot on this tagged union is missing (i.e. zero or one missing
slot). Read moreSource§fn is_partially_populated(&self) -> bool
fn is_partially_populated(&self) -> bool
true iff this
tagged union has AT LEAST ONE populated slot AND AT LEAST ONE
missing slot, i.e. it is neither Self::is_empty nor
Self::is_saturated. Read moreSource§fn lacks_only(&self, kind: Self::Kind) -> bool
fn lacks_only(&self, kind: Self::Kind) -> bool
!Self::has(kind) — true iff
the given kind is MISSING AND no OTHER slot on this tagged
union is missing. The “exactly this one variant is absent”
predicate — closed-set-complement mirror of Self::has_only. Read moreSource§impl VariantSelector<ArtifactSource> for ArtifactKind
impl VariantSelector<ArtifactSource> for ArtifactKind
Source§type Variant<'a> = ArtifactVariant<'a>
type Variant<'a> = ArtifactVariant<'a>
.variant() method — one arm per closed-set variant, each
arm carrying a &'a reference into the parent’s populated
slot. Bound generically here so TaggedUnion::variant’s
default body can name the return type without restating it
per parent. Additionally bound to VariantKind<Self> so
the reverse projection Variant<'a> → Self is closed at the
trait boundary — every implementor’s borrowed view knows its
addressing Kind through ONE typed contract, and the substrate
testkit assert_variant_round_trip composes select
(forward) with variant_kind (reverse) generically.Source§fn select<'a>(self, parent: &'a ArtifactSource) -> Option<ArtifactVariant<'a>>where
Self: 'a,
fn select<'a>(self, parent: &'a ArtifactSource) -> Option<ArtifactVariant<'a>>where
Self: 'a,
&'a P borrow into the optional typed variant view
for self (the addressed discriminator). Returns None iff
the matching slot on P is None. Composes the closed-set
sweep TaggedUnion::variant loops over.Auto Trait Implementations§
impl Freeze for ArtifactSource
impl RefUnwindSafe for ArtifactSource
impl Send for ArtifactSource
impl Sync for ArtifactSource
impl Unpin for ArtifactSource
impl UnsafeUnpin for ArtifactSource
impl UnwindSafe for ArtifactSource
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreimpl<T> OptionalSend for T
impl<T> OptionalSync for T
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§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();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§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();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§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();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§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();Source§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.
Source§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);