GuestPluginManager

Struct GuestPluginManager 

Source
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

Source

pub fn new() -> Self

Create a new handle to this plugin

Source

pub fn ensure_init(&self)

Load the plugin and initialize it if it hasn’t been loaded already.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.