pub fn read(
ctx: &Context,
req: ReadRequest,
) -> Result<Outcome<ReadResult>, CoreError>Expand description
Read a recipe, scale it, and report anything the parser had to say.
A RecipeSource::Path is resolved against Context::base_path, trying
both .cook and .menu when the name carries no extension. A
RecipeSource::Content is parsed as given and never touches the
filesystem; its name is only a fallback for ReadResult::title, used
when the recipe declares no title of its own.
§Errors
CoreError::RecipeNotFoundif no file matches the given path or name. Reserved for genuine absence — a file that exists but cannot be opened is anCoreError::Io, since telling a caller a file it can see is “not found” sends it looking for the wrong problem.CoreError::Ioif the file is found but cannot be read or its front matter cannot be understood. The underlying cause is insource.CoreError::Parseif the recipe has parse errors. Itsnameis the recipe’s path, matching the file therenderedreport points at.CoreError::InvalidScaleif the scale is not finite.