[][src]Macro glsp::syms

macro_rules! syms {
    (
		$(#[$struct_attr:meta])*
		$struct_vis:vis struct $struct_name:ident {
			$($vis:vis $name:ident: $contents:literal),+
		}
	) => { ... };
    (
		$(#[$struct_attr:meta])*
		$struct_vis:vis struct $struct_name:ident {
			$($vis:vis $name:ident: $contents:literal,)*
		}
	) => { ... };
}

Define a struct which contains a collection of symbols.

Caching symbols in a struct has better performance than calling glsp::sym, and it's more convenient than storing Sym fields in your own structs directly.

The struct defines a method fn new() -> GResult<Self> which initializes each field by passing the given string literal to glsp::sym.

syms! {
	#[derive(Clone)]
	pub struct Syms {
		pub width: "width",
		pub set_width: "width=",
		rectp: "rect?"
	}
}