Loading RustViz Engine...
Enforce compile-time linear type state progression (Draft -> Sealed -> Published).
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub struct DraftDoc { content: String }
pub struct SealedDoc { content: String, hash: u64 }
pub struct PublishedDoc { content: String, url: String }
impl DraftDoc {
pub fn seal(self, hash: u64) -> SealedDoc {
SealedDoc { content: self.content, hash }
}
}
impl SealedDoc {
pub fn publish(self, url: String) -> PublishedDoc {
PublishedDoc { content: self.content, url }
}
}