Struct optee_utee::TeeParams

source ·
pub struct TeeParams<'a> { /* private fields */ }
Expand description

The TeeParams struct is used to manage the parameters for TEE commands.

Implementations§

source§

impl<'a> TeeParams<'a>

source

pub fn new() -> Self

source

pub fn with_memref_in(self, idx: ParamIndex, buffer: &'a [u8]) -> Self

These functions allow for method-chaining to easily configure multiple parameters at once.

The following methods can be chained:

  • with_memref_in: Sets a memory reference input parameter.
  • with_memref_out: Sets a memory reference output parameter.
  • with_memref_inout: Sets a memory reference inout parameter.
  • with_value_in: Sets a value input parameter.
  • with_value_out: Sets a value output parameter.
  • with_value_inout: Sets a value inout parameter.

Example usage:


let params = TeeParams::new()
    .with_memref_in(ParamIndex::Arg0, &input_buffer)
    .with_memref_out(ParamIndex::Arg1, &mut output_buffer)
    .with_value_in(ParamIndex::Arg2, 42, 0)
    .with_value_out(ParamIndex::Arg3, 0, 0);
source

pub fn with_memref_out(self, idx: ParamIndex, buffer: &'a mut [u8]) -> Self

source

pub fn with_memref_inout(self, idx: ParamIndex, buffer: &'a mut [u8]) -> Self

source

pub fn with_value_in(self, idx: ParamIndex, a: u32, b: u32) -> Self

source

pub fn with_value_out(self, idx: ParamIndex, a: u32, b: u32) -> Self

source

pub fn with_value_inout(self, idx: ParamIndex, a: u32, b: u32) -> Self

source

pub fn set_memref_in(&mut self, idx: ParamIndex, buffer: &'a [u8]) -> &mut Self

These methods allow the user to set the content at a specific index.

Example usage:


let mut params = TeeParams::new();
params.set_memref_in(ParamIndex::Arg0, &input_buffer);
params.set_memref_out(ParamIndex::Arg1, &mut output_buffer);
params.set_value_in(ParamIndex::Arg2, 42, 0);
params.set_value_out(ParamIndex::Arg3, 0, 0);
source

pub fn set_memref_out( &mut self, idx: ParamIndex, buffer: &'a mut [u8] ) -> &mut Self

source

pub fn set_memref_inout( &mut self, idx: ParamIndex, buffer: &'a mut [u8] ) -> &mut Self

source

pub fn set_value_in(&mut self, idx: ParamIndex, a: u32, b: u32) -> &mut Self

source

pub fn set_value_out(&mut self, idx: ParamIndex, a: u32, b: u32) -> &mut Self

source

pub fn set_value_inout(&mut self, idx: ParamIndex, a: u32, b: u32) -> &mut Self

Trait Implementations§

source§

impl<'a> Index<ParamIndex> for TeeParams<'a>

§

type Output = Param<'a>

The returned type after indexing.
source§

fn index(&self, index: ParamIndex) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a> IndexMut<ParamIndex> for TeeParams<'a>

source§

fn index_mut(&mut self, index: ParamIndex) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TeeParams<'a>

§

impl<'a> RefUnwindSafe for TeeParams<'a>

§

impl<'a> Send for TeeParams<'a>

§

impl<'a> Sync for TeeParams<'a>

§

impl<'a> Unpin for TeeParams<'a>

§

impl<'a> !UnwindSafe for TeeParams<'a>

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>,

§

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>,

§

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.