Skip to main content

DraftLaws

Trait DraftLaws 

Source
pub trait DraftLaws<This>{
    // Required method
    fn draft_laws(&mut self) -> Result<()>;
}
Expand description

Authors the editor-draft laws.

Required Methods§

Source

fn draft_laws(&mut self) -> Result<()>

Checks that a draft is observed back and submits exactly the sources it names.

The laws checked are:

  1. a draft is observed back exactly as it was replaced;
  2. the source draft and the output-name draft are independent;
  3. submitting adds the non-blank trimmed lines in draft order and nothing else;
  4. submitting clears the draft and denotes the collection;
  5. submitting a draft naming no source adds nothing and moves no focus.
§Errors

Returns the first violated law.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§