Skip to main content

PluginConfig

Struct PluginConfig 

Source
pub struct PluginConfig { /* private fields */ }
Expand description

Configuration for building an OP-TEE supplicant plugin binding.

Holds the plugin name, UUID, init/invoke function names, and optional output destination. Use the builder-style API (with_* methods) to customize defaults, then call PluginConfig::build to generate the plugin_static.rs file.

Implementations§

Source§

impl PluginConfig

Source

pub fn new(uuid: Uuid) -> Self

Creates a new PluginConfig with the given UUID.

The plugin name defaults to CARGO_PKG_NAME, and the init/invoke function names default to DEFAULT_INIT_FN_NAME and DEFAULT_INVOKE_FN_NAME respectively.

Source

pub fn with_name(self, name: &str) -> Self

Sets a custom plugin name.

Source

pub fn with_init_fn_name(self, fn_name: &str) -> Self

Sets a custom init function name (overriding DEFAULT_INIT_FN_NAME).

Source

pub fn with_invoke_fn_name(self, fn_name: &str) -> Self

Sets a custom invoke function name (overriding DEFAULT_INVOKE_FN_NAME).

Source

pub fn with_dest(self, out_path: PathBuf) -> Self

Sets a custom output file path

Source

pub fn build(&self) -> Result<()>

Generates the plugin binding source and writes it to the output file.

If the output file already exists with identical content, the write is skipped. The default output path is $OUT_DIR/plugin_static.rs.

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.