[][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 sym!, and it's more convenient than storing Sym fields in your own structs directly.

The struct defines a constructor fn new() -> Self, which initializes each field by passing the given string literal to glsp::sym. If any of the string literals are invalid symbols, the constructor will panic.

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