pub struct WeakXiCore(/* private fields */);
Expand description
A weak reference to the main state. This is passed to plugin threads.
Implementations§
Source§impl WeakXiCore
impl WeakXiCore
Sourcepub fn plugin_connect(&self, plugin: Result<Plugin, Error>)
pub fn plugin_connect(&self, plugin: Result<Plugin, Error>)
Called immediately after attempting to start a plugin, from the plugin’s thread.
Sourcepub fn plugin_exit(&self, plugin: PluginId, error: Result<(), ReadError>)
pub fn plugin_exit(&self, plugin: PluginId, error: Result<(), ReadError>)
Called from a plugin runloop thread when the runloop exits.
Sourcepub fn handle_plugin_update(
&self,
plugin: PluginId,
view: ViewId,
response: Result<Value, RpcError>,
)
pub fn handle_plugin_update( &self, plugin: PluginId, view: ViewId, response: Result<Value, RpcError>, )
Handles the result of an update sent to a plugin.
All plugins must acknowledge when they are sent a new update, so that core can track which revisions are still ‘live’, that is can still be the base revision for a delta. Once a plugin has acknowledged a new revision, it can no longer send deltas against any older revision.
Trait Implementations§
Source§impl Clone for WeakXiCore
impl Clone for WeakXiCore
Source§fn clone(&self) -> WeakXiCore
fn clone(&self) -> WeakXiCore
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Handler for WeakXiCore
Handler for messages originating from plugins.
impl Handler for WeakXiCore
Handler for messages originating from plugins.
type Notification = PluginCommand<PluginNotification>
type Request = PluginCommand<PluginRequest>
fn handle_notification(&mut self, ctx: &RpcCtx, rpc: Self::Notification)
fn handle_request( &mut self, ctx: &RpcCtx, rpc: Self::Request, ) -> Result<Value, RemoteError>
fn idle(&mut self, ctx: &RpcCtx, token: usize)
Auto Trait Implementations§
impl Freeze for WeakXiCore
impl RefUnwindSafe for WeakXiCore
impl Send for WeakXiCore
impl Sync for WeakXiCore
impl Unpin for WeakXiCore
impl UnwindSafe for WeakXiCore
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