Skip to main content

Role

Enum Role 

Source
pub enum Role {
Show 18 variants CapturedDeclaration, Plan, OriginNode, GeneratedUnit, RenderedUnit, OutputBytes, Bundle, Closure, ClosedExpansion, ProjectionIntent, Explanation, DeclarationDocumentation, DeclaredName, GeneratorVersion, DiagnosticRelation, CapturedHelper, ProjectionContent, ProjectionKind,
}
Expand description

The seat one identity stands in inside its grammar.

A role is part of the derive-key context AND a member of every transcript, so two identities derived from one anchor under different roles are different twice over: separated before a byte of the transcript is read, and disagreeing inside it.

A row’s declared name and slot are what the bytes carry, so a row is APPENDED and never renumbered — renumbering an occupied slot re-encodes transcripts that were already encoded.

Variants§

§

CapturedDeclaration

The token material one expansion was handed.

§

Plan

One projection plan.

§

OriginNode

One node of the origin graph.

§

GeneratedUnit

One generated unit a plan declares it will materialize.

§

RenderedUnit

One rendered unit a renderer actually materialized.

§

OutputBytes

The canonical bytes of one rendered unit.

§

Bundle

One bundle materialized across a single publication boundary.

§

Closure

One proved closure between a plan and its rendering.

§

ClosedExpansion

One closed expansion.

§

ProjectionIntent

One projection intent — what a request meant, ahead of what it decided.

§

Explanation

One explanation, answered over a plan and its closure.

§

DeclarationDocumentation

The documentation rows one captured declaration carries, read as a second fact over the surface its semantic commitment already names.

§

DeclaredName

One stable name this compiler wrote down.

§

GeneratorVersion

The generator’s declared name and the shape it renders.

§

DiagnosticRelation

One refusal body, or one issue inside it, as a diagnostic points at it.

§

CapturedHelper

One helper attribute’s material, read as an independent fact over the surface its semantic commitment already names.

Several helpers may stand here at once; they are separated by the roster position each one is derived at, never by a grammar of their own.

§

ProjectionContent

One kind-specific content commitment.

§

ProjectionKind

One projection kind qualified by the producer that owns its generated names.

Implementations§

Source§

impl Role

Source

pub const ALL: &'static [Self]

The complete roster, in slot order.

Source

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

The role’s declared segment of the derive-key context.

Declared rather than taken from the Rust spelling, for the reason a subject’s name is: changing one of these literals renames every identity ever derived at that seat.

Source

pub const fn slot(self) -> u8

The published byte member six of every transcript carries for this role.

Source

pub const fn described(self) -> &'static str

The seat rendered for a person. A projection: nothing reads it back.

Source

pub const fn profile(self) -> Profile

The preimage grammar a transcript at this role stands in.

Total, and the ONE road from a mint site to a version ladder: a call site names the seat it is deriving for, and the grammar follows rather than being passed alongside it. A road that took both would admit a rendered unit derived under the plan grammar’s position, which is a disagreement no reader of the resulting bytes could see.

§Bounds

Total and never injective. Two seats standing over ONE grammar answer with one profile and are separated inside it by the role, which is a member of the transcript and a segment of the context: Role::RenderedUnit names a rendered unit and Role::OutputBytes names the digest of exactly that unit’s bytes, so both read here to RENDERED_UNIT_PROFILE.

Nothing reads back: a grammar names no role, because a grammar is a preimage several seats may stand over and a role is one seat inside it.

Trait Implementations§

Source§

impl Clone for Role

Source§

fn clone(&self) -> Role

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 Copy for Role

Source§

impl Debug for Role

Source§

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

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

impl Eq for Role

Source§

impl Hash for Role

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Role

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Role

Auto Trait Implementations§

§

impl Freeze for Role

§

impl RefUnwindSafe for Role

§

impl Send for Role

§

impl Sync for Role

§

impl Unpin for Role

§

impl UnsafeUnpin for Role

§

impl UnwindSafe for Role

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<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<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> 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.