pub struct MuxState { /* private fields */ }
Implementations§
Source§impl MuxState
impl MuxState
Sourcepub fn new(
name: &str,
lang: impl Lang + 'static,
syntax_theme: Box<dyn SyntaxTheme>,
) -> Self
pub fn new( name: &str, lang: impl Lang + 'static, syntax_theme: Box<dyn SyntaxTheme>, ) -> Self
Create a new instance of lang
Must be initialized with at least one language
Sourcepub fn register_lang(&mut self, name: &str, lang: impl Lang + 'static)
pub fn register_lang(&mut self, name: &str, lang: impl Lang + 'static)
Register a language using a name
If the language has already been registered previously, it is overwritten
pub fn register_theme(&mut self, name: &str, syntax_theme: Box<dyn SyntaxTheme>)
Sourcepub fn current_lang(&self) -> Rc<dyn Lang>
pub fn current_lang(&self) -> Rc<dyn Lang>
Get the current language
Sourcepub fn set_current_lang(&mut self, name: &str) -> Result<()>
pub fn set_current_lang(&mut self, name: &str) -> Result<()>
Set the language using the name
Selecting invalid language returns error
pub fn iter(&self) -> impl Iterator<Item = (&String, &Rc<dyn Lang>)>
Auto Trait Implementations§
impl Freeze for MuxState
impl !RefUnwindSafe for MuxState
impl !Send for MuxState
impl !Sync for MuxState
impl Unpin for MuxState
impl !UnwindSafe for MuxState
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