pub struct Plugin { /* private fields */ }Implementations§
Source§impl Plugin
impl Plugin
pub fn new_from_source( source: &str, app_context: &mut AppContext<'_>, ) -> Result<Self, Box<dyn Error>>
pub fn new_from_file( path: &str, app_context: &mut AppContext<'_>, ) -> Result<Self, Box<dyn Error>>
pub fn get_event_handlers(&self) -> Events
Sourcepub fn handle_with_error(
&mut self,
event: Event<'_>,
app_context: &mut AppContext<'_>,
) -> Result<()>
pub fn handle_with_error( &mut self, event: Event<'_>, app_context: &mut AppContext<'_>, ) -> Result<()>
Handle an event, if an error occurs, return the error see Plugin::handle for a version that logs the error
pub fn handle(&mut self, event: Event<'_>, app_context: &mut AppContext<'_>)
pub fn run_command( &mut self, command: &str, app_context: &mut AppContext<'_>, ) -> Result<()>
pub fn get_commands(&self) -> &[CommandInfo]
pub fn fill_popup( &self, callback: impl AsRef<str>, popup_context: PopupContext<'_>, app_context: AppContext<'_>, ) -> Result<()>
pub fn try_parse_header( &mut self, app_context: &mut AppContext<'_>, ) -> Option<CustomHeader>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plugin
impl !RefUnwindSafe for Plugin
impl !Send for Plugin
impl !Sync for Plugin
impl Unpin for Plugin
impl !UnwindSafe for Plugin
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
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