Skip to main content

capture_set

Function capture_set 

Source
pub fn capture_set<'a>(
    docs: impl IntoIterator<Item = (&'a str, &'a Doc)>,
) -> Result<Vec<Generated>, String>
Expand description

Every capture file a package needs: one block_<id>.rs module per capture block under CAPTURE_DIR, and the main.rs that runs the block its first argument names. Empty when no page has a capture block.

A block with a feature= tag (feature=A,B for all of them) compiles in only under its features; without them the example exits with CAPTURE_DISABLED, so a capture run can keep the recorded output rather than splice in nothing. A block keeps its own top-level fn main, whatever it returns or however it is attributed (#[tokio::main]); a block without one becomes the body of one. An error names a page whose block uses a crate-level attribute, which a module cannot carry, or two pages whose paths sanitize to the same block ids.