pub enum Style {
Pretty,
Compact,
}Expand description
How Grammar::write_json lays out its output.
§Examples
use textmate_lang::{Grammar, Style};
let grammar = Grammar::new("source.demo");
let mut out = String::new();
grammar.write_json(&mut out, Style::Compact)?;
assert_eq!(out, r#"{"scopeName":"source.demo","patterns":[]}"#);
out.clear();
grammar.write_json(&mut out, Style::Pretty)?;
assert_eq!(out, "{\n \"scopeName\": \"source.demo\",\n \"patterns\": []\n}\n");Variants§
Pretty
Two-space indentation, one member per line, "key": value, and a
final newline: the layout of hand-written grammar files.
Compact
No whitespace at all: the smallest output, for embedding or shipping.
Trait Implementations§
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more