pub trait Alloc<'a> {
type Argv: Into<[usize; 4]>;
type Ret;
type Staged: Commit<Item = Self::Committed>;
type Committed;
type Collected;
const NUM: Number;
fn stage(
self,
alloc: &mut impl Allocator
) -> Result<(Self::Argv, Self::Staged)>;
fn collect(
committed: Self::Committed,
ret: Result<Self::Ret>,
col: &impl Collector
) -> Self::Collected;
}
Expand description
A generic Enarx call, which can be allocated within the block.
Required Associated Types
The Enarx call argument vector.
For example, guest::call::types::Argv<2>
.
Opaque staged value, which returns Self::Committed
when committed via Commit::commit
.
This is designed to serve as a container for dynamic data allocated within stage
.
For example, Input<'a, [u8], &'a [u8]>
.
Opaque committed value
returned by guest::alloc::Commit::commit
called upon Self::Staged
, which returns Self::Collected
when
collected via guest::alloc::Collect::collect
.
Value Enarx call collects as, which corresponds to its return value.
For example, Option<Result<usize>>
.
Required Associated Constants
Enarx call number.
For example, item::enarxcall::Number::Cpuid
.
Required Methods
Allocate dynamic data, if necessary and return resulting argument vector registers and opaque staged value on success.
Collect the return registers, opaque committed value
and return a Self::Collected
.