Skip to main content

SelectVariant

Struct SelectVariant 

Source
pub struct SelectVariant {
    pub field: String,
    pub value: u32,
}
Expand description

select-variant{field=NAME,value=N} (both required: the choice is the caller’s): in every ShaderBinding that has stages keyed by field (super::VariantKey), the stages of the variant value stay, without their key, and the stages of the other variants of that field are left out, counted. The binding then holds one stage of each kind under no key, as a consumer that draws one program of a stage reads it. A stage with no key or a key of another field is left as it is; a binding with no stage keyed by field, or none of the value value (a source numbers a binding’s variants from 0, so bindings hold different numbers of them), is left as it is and counted. A value that no binding of the world carries, or a field none uses, is an error naming the fields and values the world does carry, and changes nothing. A program only the stages left out drew (its core.shader entity, which nothing in the world refers to any more) is despawned, counted.

Fields§

§field: String§value: u32

Trait Implementations§

Source§

impl Clone for SelectVariant

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SelectVariant

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for SelectVariant

Source§

impl PartialEq for SelectVariant

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Pass for SelectVariant

Source§

fn modifies(&self) -> &[&'static str]

The stages of the other variants are taken out of the binding in place, and the chosen ones lose their key.

Source§

fn despawns_entities(&self) -> bool

The programs only the left-out stages drew.

Source§

fn name(&self) -> &'static str

Stable name, used in pipelines and reports (load-meshes).
Source§

fn options(&self) -> Options

The options this instance was made with (printed into the pipeline).
Source§

fn requires(&self) -> &[&'static str]

Names that must be present before it runs.
Source§

fn run(&self, w: &mut World, log: &mut PassLog) -> Result<(), String>

Source§

fn may_lack_inputs(&self) -> bool

Whether a run may skip it in a world (or a part) that holds none of its required names: a lowering whose input the world may simply not have (a part of only a light has no materials, a read region no lights) opts in; the step is recorded as skipped (StepReport::skipped). Required names are prerequisites, so this is false unless the pass says otherwise: an absent name may be a failed load or a wrong order, and a pass that summarizes, decides or plans never opts in.
Source§

fn settings(&self) -> &[Setting]

The run settings it reads, which the program states for the run on its manager (its thread count, crate::parallel::THREADS, PassManager::with_settings): checked with Pass::requires before it runs and refused where absent, never counted in whether it is skipped (Pass::may_lack_inputs), and stated in its step’s report.
Source§

fn provides(&self) -> &[&'static str]

Names it may add.
Source§

fn removes(&self) -> &[&'static str]

Names it may take away (what it lowers).
Source§

fn approximates(&self) -> &'static str

What it approximates, in words (empty when it is exact).
Source§

fn removes_by_log(&self) -> bool

Whether the components it removes are not all known in advance (a hook decides, as crate::Component::apply_linear does). If so, a component name that disappears is accepted when the pass recorded it in PassLog::removed as well as when it is declared in Pass::removes; a name that disappears unrecorded and undeclared is an error as ever, and a resource it removes must be declared as for any pass.
Source§

fn settles(&self) -> &[&'static str]

Names whose values it brings to their final form (a classifier: every surface classified). A later pass in a pipeline that provides one of them adds values that never went through this pass: unless a pass after it settles the name again, PassManager::run refuses such a pipeline before it runs (Error::SettledThenChanged). Modifying settled values later is allowed. A modifier must not add values without declaring them in Pass::provides; the target’s value rules check the result.
Source§

impl StructuralPartialEq for SelectVariant

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.