Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created June 15, 2022 22:36
Show Gist options
  • Save jcrossley3/fda5d4e94e8b5e8284312452733caf47 to your computer and use it in GitHub Desktop.
Save jcrossley3/fda5d4e94e8b5e8284312452733caf47 to your computer and use it in GitHub Desktop.
struct Provisionee<S> {
state: S,
}
impl Provisionee<Invite> {
fn new() -> Self {
Provisionee { state: Invite }
}
}
impl From<Provisionee<Invite>> for Provisionee<Capabilities> {
fn from(val: Provisionee<Invite>) -> Provisionee<Capabilities> {
Provisionee {
state: Capabilities,
}
}
}
impl From<Provisionee<Capabilities>> for Provisionee<Start> {
fn from(val: Provisionee<Capabilities>) -> Provisionee<Start> {
Provisionee { state: Start }
}
}
struct Invite;
struct Capabilities;
struct Start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment