Learning

Core Ideas

One Story, Many Registrations

Separate one selected story from its actual occurrences.

Downloads

Ari registers today. Bima registers tomorrow. Their details differ, but both registrations can follow the same selected promise.

A story is that promise expressed as a compile-time abstraction: a structure Rust can use to restrict permitted combinations and operations. An occurrence is one particular piece of work using actual data and resources.

Question Answer
Which policy applies? The selected story says whether confirmation is required for entry.
Which code carries it out? The realization connects that selection to verification, recording and entry checks.
Whose registration is this? This occurrence binds Ari's assertion, subject and workshop instance.
One promise can govern different registrations. One selected story constrains the workshop realization, which handles separate occurrences for Ari and Bima.One promise can govern different registrations. One selected story constrains the workshop realization, which handles separate occurrences for Ari and Bima.

Calling every request a different story hides what is shared. Calling every request “the same story” without retaining its actual data hides what is different.

Engineering Depth

These are different policy selections:

pub type OpenWorkshop<P> = Workshop<Google<P>, WithoutPassword, CookieValid>;
pub type ConfirmedWorkshop<P> = Workshop<Google<P>, WithoutPassword, ConfirmedOnly>;

Now consider two values of the same selection, using demonstration providers:

let morning = OpenWorkshop::new(Google::new(
    DemonstrationGoogle::new("assertion-a", "ari"),
));
let evening = OpenWorkshop::new(Google::new(
    DemonstrationGoogle::new("assertion-b", "bima"),
));

They share a Rust type and entry policy. They do not share a provider instance or store. A handle belonging to morning must not be accepted by evening merely because its type matches.

Difference Chosen in This Model
Entry policy Type selection: CookieValid or ConfirmedOnly
Actual provider and records Data held by a particular workshop value
Current session validity A runtime check on each visit

The demonstration providers compare strings. They are fixtures, not real Google authentication.

Your Reflection

Ari and Bima use the same policy and provider type. Which facts must still stay distinct?

Worked Discussion

Their submitted assertions, verified subjects, account records, sessions and owning workshop instances. The shared type explains compatible behavior; it does not identify the same work. That is why the binding lesson keeps actual data with its continuation.

Navigation