#[non_exhaustive]pub struct NoteShape {
pub bom: bool,
pub open_eol: OpenEol,
pub close_eol: CloseEol,
pub close_sep: bool,
}Expand description
Everything about a note’s framing that a writer has to put back exactly.
Without it, a writer that edits the values carefully can still write ---\n
fences over a file whose fences were ---\r\n. Then every line of the note
shows as changed in git. The fences have to be kept too.
Take one from split and pass it back to compose. For a new note with
no source text, take one from new_shape. The fields are public to read,
but the type is #[non_exhaustive]. Build one with new_shape, never a
struct literal, so a later field is not a breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.bom: boolThe byte-order mark, if the file had one.
open_eol: OpenEolLine ending after the opening ---.
close_eol: CloseEolLine ending after the closing ---. CloseEol::None when the file
ended there.
close_sep: boolWhether the \n between the block’s content and the closing --- is
present. True for every block except the empty one with no line between
the fences (---\n---), where the closing fence directly follows the
opening fence’s newline. It is a separate field because Split::yaml
alone cannot tell that block from one that holds only a blank line
(---\n\n---). Both give Some(""), but only the second has a
separator byte to restore.