#[non_exhaustive]pub struct MacroLibrary {
pub version: u32,
pub macros: Vec<Macro>,
}Available on crate features
state and storage only.Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.version: u32File format version.
macros: Vec<Macro>The macros.
Implementations§
Source§impl MacroLibrary
impl MacroLibrary
Sourcepub fn record_from(
&mut self,
journal: &CommandJournal,
after_sequence: u64,
name: impl Into<String>,
) -> &Macro
pub fn record_from( &mut self, journal: &CommandJournal, after_sequence: u64, name: impl Into<String>, ) -> &Macro
Record the entries after after_sequence as a new macro and return it.
Sourcepub fn by_command(&self, command: &CommandId) -> Option<&Macro>
pub fn by_command(&self, command: &CommandId) -> Option<&Macro>
A macro by its command id.
Sourcepub fn register(&self, registry: &mut CommandRegistry)
pub fn register(&self, registry: &mut CommandRegistry)
Register every macro as a command in registry.
Trait Implementations§
Source§impl Clone for MacroLibrary
impl Clone for MacroLibrary
Source§impl Debug for MacroLibrary
impl Debug for MacroLibrary
Source§impl Default for MacroLibrary
impl Default for MacroLibrary
Source§impl<'de> Deserialize<'de> for MacroLibrary
impl<'de> Deserialize<'de> for MacroLibrary
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MacroLibrary
impl PartialEq for MacroLibrary
Source§impl Serialize for MacroLibrary
impl Serialize for MacroLibrary
impl StructuralPartialEq for MacroLibrary
Auto Trait Implementations§
impl Forget for MacroLibrary
impl Freeze for MacroLibrary
impl Move for MacroLibrary
impl RefUnwindSafe for MacroLibrary
impl Send for MacroLibrary
impl Sync for MacroLibrary
impl Unpin for MacroLibrary
impl UnsafeUnpin for MacroLibrary
impl UnwindSafe for MacroLibrary
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more