pub struct ForeignCallResult<F> {
pub values: Vec<ForeignCallParam<F>>,
}Expand description
Represents the full output of a foreign call.
A foreign call can return multiple outputs, where each output can be either a single field element or an array. This struct wraps a vector of ForeignCallParam to represent all outputs from a single foreign call.
Fields§
§values: Vec<ForeignCallParam<F>>Resolved output values of the foreign call.
Each element represents one output, which can be either a single value or an array.
Trait Implementations§
Source§impl<F: Clone> Clone for ForeignCallResult<F>
impl<F: Clone> Clone for ForeignCallResult<F>
Source§fn clone(&self) -> ForeignCallResult<F>
fn clone(&self) -> ForeignCallResult<F>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F: Debug> Debug for ForeignCallResult<F>
impl<F: Debug> Debug for ForeignCallResult<F>
Source§impl<F: Default> Default for ForeignCallResult<F>
impl<F: Default> Default for ForeignCallResult<F>
Source§fn default() -> ForeignCallResult<F>
fn default() -> ForeignCallResult<F>
Source§impl<'de, F> Deserialize<'de> for ForeignCallResult<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for ForeignCallResult<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<F> From<F> for ForeignCallResult<F>
Convenience conversion for a foreign call returning a single field element value.
impl<F> From<F> for ForeignCallResult<F>
Convenience conversion for a foreign call returning a single field element value.
Creates a ForeignCallResult with one output containing the single value.
Source§impl<F> From<Vec<F>> for ForeignCallResult<F>
Conversion for a foreign call returning a single array output.
Creates a ForeignCallResult with one output, where that output is an array.
This represents one array output, not multiple single-value outputs:
impl<F> From<Vec<F>> for ForeignCallResult<F>
Conversion for a foreign call returning a single array output.
Creates a ForeignCallResult with one output, where that output is an array.
This represents one array output, not multiple single-value outputs:
let result: ForeignCallResult<F> = vec![1, 2, 3].into();
// result.values.len() == 1
// result.values[0] == ForeignCallParam::Array([1, 2, 3])For multiple single-value outputs, use From<Vec<ForeignCallParam<F>>> instead:
let result: ForeignCallResult<F> = vec![
ForeignCallParam::Single(1),
ForeignCallParam::Single(2),
ForeignCallParam::Single(3)
].into();
// result.values.len() == 3Source§impl<F> From<Vec<ForeignCallParam<F>>> for ForeignCallResult<F>
Conversion for a foreign call returning multiple outputs.
impl<F> From<Vec<ForeignCallParam<F>>> for ForeignCallResult<F>
Conversion for a foreign call returning multiple outputs.
Each element in the vector represents a separate output, which can be either a single value or an array.
Source§fn from(values: Vec<ForeignCallParam<F>>) -> Self
fn from(values: Vec<ForeignCallParam<F>>) -> Self
Source§impl<F: PartialEq> PartialEq for ForeignCallResult<F>
impl<F: PartialEq> PartialEq for ForeignCallResult<F>
Source§impl<F> Serialize for ForeignCallResult<F>where
F: Serialize,
impl<F> Serialize for ForeignCallResult<F>where
F: Serialize,
impl<F: Eq> Eq for ForeignCallResult<F>
impl<F> StructuralPartialEq for ForeignCallResult<F>
Auto Trait Implementations§
impl<F> Freeze for ForeignCallResult<F>
impl<F> RefUnwindSafe for ForeignCallResult<F>where
F: RefUnwindSafe,
impl<F> Send for ForeignCallResult<F>where
F: Send,
impl<F> Sync for ForeignCallResult<F>where
F: Sync,
impl<F> Unpin for ForeignCallResult<F>where
F: Unpin,
impl<F> UnwindSafe for ForeignCallResult<F>where
F: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 more