pub struct GuestPluginManager { /* private fields */ }Expand description
A PANDA plugin which manages “guest plugins”, programs which are injected into the guest which can communicate with the host process via “channels”.test
Unless you need greater control, it is recommended to use load_guest_plugin rather
than using the GUEST_PLUGIN_MANAGER object directly.
Implementations§
Source§impl GuestPluginManager
impl GuestPluginManager
Sourcepub fn ensure_init(&self)
pub fn ensure_init(&self)
Load the plugin and initialize it if it hasn’t been loaded already.
Sourcepub fn add_guest_plugin(&self, plugin: GuestPlugin) -> ChannelId
pub fn add_guest_plugin(&self, plugin: GuestPlugin) -> ChannelId
Add a guest plugin to the guest plugin manager, loading it into the guest as soon as possible.
Sourcepub fn channel_write(&self, channel: ChannelId, out: *const u8, out_len: usize)
pub fn channel_write(&self, channel: ChannelId, out: *const u8, out_len: usize)
Write to a channel, buffering the message until the guest performs a read to the channel.
Sourcepub fn get_channel_from_name(&self, channel_name: *const c_char) -> ChannelId
pub fn get_channel_from_name(&self, channel_name: *const c_char) -> ChannelId
Get a channel given a name, typically the name of the guest plugin it is associated with, as each guest plugin is allocated a “main” channel of the same name.
Sourcepub fn allocate_channel(&self, callback: ChannelCB) -> ChannelId
pub fn allocate_channel(&self, callback: ChannelCB) -> ChannelId
Create a new channel given a callback for handling writes, returns the ID of the newly allocated channel.