pub struct ArgsBuilder { /* private fields */ }Expand description
A type for passing arguments to Parasol programs. When invoking
crate::FheComputer::run_program, the processor will transparently set up the registers
and first stack frame according to Parasol ABI’s calling convention.
§Remarks
Parasol’s calling convention is similar to x86’s cdecl. We first allocate stack space for storing all arguments and the return value as well as padding to maintain alignment requirements for each argument and the return value. Furthermore, the stack pointer must be 16-byte aligned after pushing all the call data. Arguments are stored in reverse order (i.e. the first argument appears at SP+0 while the second at SP+sizeof(arg1), and so-on), followed by the return value.
Parasol stacks grow downwards, while arguments and values within a frame grow upwards.
Implementations§
Source§impl ArgsBuilder
impl ArgsBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ArgsBuilder.
Sourcepub fn arg_dyn<T: DynamicToArg>(self, val: T) -> Self
pub fn arg_dyn<T: DynamicToArg>(self, val: T) -> Self
Similar to ArgsBuilder::arg but the value is DynamicToArg
Sourcepub fn return_value<T: ToArg>(self) -> CallData<T>
pub fn return_value<T: ToArg>(self) -> CallData<T>
Specify a return value for an FHE program.
Sourcepub fn return_value_dyn(
self,
align: usize,
num_bytes: usize,
) -> CallData<Vec<Byte>>
pub fn return_value_dyn( self, align: usize, num_bytes: usize, ) -> CallData<Vec<Byte>>
Specify a return value for an FHE program using the alignment and size.
Sourcepub fn no_return_value(self) -> CallData<()>
pub fn no_return_value(self) -> CallData<()>
Create the CallData object from this builder, ignoring any value the program returns (if any).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ArgsBuilder
impl !RefUnwindSafe for ArgsBuilder
impl Send for ArgsBuilder
impl Sync for ArgsBuilder
impl Unpin for ArgsBuilder
impl UnsafeUnpin for ArgsBuilder
impl !UnwindSafe for ArgsBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.