Scribe

Derive Macro Scribe 

Source
#[derive(Scribe)]
{
    // Attributes available to this derive:
    #[transcript]
}
Expand description

Procedural macro to automatically implement the Scribe trait for a struct.

§Requirements

  • The struct must have a field marked with #[transcript] or, if not present, a field named transcript that implements Transcript.

§Behavior

  • Implements the transcript(&mut self) method, returning a mutable reference to the selected field.

§Usage

#[derive(Scribe)]
pub struct MyParty {
    #[transcript]
    my_transcript: MyTranscriptType,
    // ...
}
// or, fallback:
#[derive(Scribe)]
pub struct MyParty { transcript: MyTranscriptType, ... }