pub struct ViewFunctionInfo<'info, TypeId: Clone> {
pub query_id: [u8; 32],
pub inputs: Cow<'info, [ViewFunctionInput<'info, TypeId>]>,
pub output_id: TypeId,
}Expand description
Information about a View Function.
Fields§
§query_id: [u8; 32]The query Id to use to call the view function.
inputs: Cow<'info, [ViewFunctionInput<'info, TypeId>]>Inputs to the runtime API.
output_id: TypeIdThe output type returned from the runtime API.
Implementations§
Source§impl<'info, TypeId: Clone> ViewFunctionInfo<'info, TypeId>
impl<'info, TypeId: Clone> ViewFunctionInfo<'info, TypeId>
Sourcepub fn into_owned(self) -> ViewFunctionInfo<'static, TypeId>
pub fn into_owned(self) -> ViewFunctionInfo<'static, TypeId>
Take ownership of this info, turning any lifetimes to 'static.
Sourcepub fn map_ids<NewTypeId: Clone, E, F: FnMut(TypeId) -> Result<NewTypeId, E>>(
self,
f: F,
) -> Result<ViewFunctionInfo<'static, NewTypeId>, E>
pub fn map_ids<NewTypeId: Clone, E, F: FnMut(TypeId) -> Result<NewTypeId, E>>( self, f: F, ) -> Result<ViewFunctionInfo<'static, NewTypeId>, E>
Map the type IDs in this ViewFunctionInfo, returning a new one or bailing early with an error if something goes wrong.
This also takes ownership of the ViewFunctionInfo, turning the lifetime to static.
Trait Implementations§
Source§impl<'info, TypeId: Clone + Clone> Clone for ViewFunctionInfo<'info, TypeId>
impl<'info, TypeId: Clone + Clone> Clone for ViewFunctionInfo<'info, TypeId>
Source§fn clone(&self) -> ViewFunctionInfo<'info, TypeId>
fn clone(&self) -> ViewFunctionInfo<'info, TypeId>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'info, TypeId: PartialEq + Clone> PartialEq for ViewFunctionInfo<'info, TypeId>
impl<'info, TypeId: PartialEq + Clone> PartialEq for ViewFunctionInfo<'info, TypeId>
Source§fn eq(&self, other: &ViewFunctionInfo<'info, TypeId>) -> bool
fn eq(&self, other: &ViewFunctionInfo<'info, TypeId>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'info, TypeId: Eq + Clone> Eq for ViewFunctionInfo<'info, TypeId>
impl<'info, TypeId: Clone> StructuralPartialEq for ViewFunctionInfo<'info, TypeId>
Auto Trait Implementations§
impl<'info, TypeId> Freeze for ViewFunctionInfo<'info, TypeId>where
TypeId: Freeze,
impl<'info, TypeId> RefUnwindSafe for ViewFunctionInfo<'info, TypeId>where
TypeId: RefUnwindSafe,
impl<'info, TypeId> Send for ViewFunctionInfo<'info, TypeId>
impl<'info, TypeId> Sync for ViewFunctionInfo<'info, TypeId>where
TypeId: Sync,
impl<'info, TypeId> Unpin for ViewFunctionInfo<'info, TypeId>where
TypeId: Unpin,
impl<'info, TypeId> UnwindSafe for ViewFunctionInfo<'info, TypeId>where
TypeId: UnwindSafe + RefUnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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