pub struct CallFlags { /* private fields */ }
Expand description
The flags used to change the behavior of a contract call.
Implementations
sourceimpl CallFlags
impl CallFlags
sourcepub const fn set_forward_input(self, forward_input: bool) -> Self
pub const fn set_forward_input(self, forward_input: bool) -> Self
Forwards the input for the current function to the callee.
Note
A forwarding call will consume the current contracts input. Any attempt to
access the input after this call returns (e.g. by trying another forwarding call)
will lead to a contract revert.
Consider using Self::set_clone_input
in order to preserve the input.
sourcepub const fn set_clone_input(self, clone_input: bool) -> Self
pub const fn set_clone_input(self, clone_input: bool) -> Self
Identical to Self::set_forward_input
but without consuming the input.
This adds some additional weight costs to the call.
Note
This implies Self::set_forward_input
and takes precedence when both are set.
sourcepub const fn set_tail_call(self, tail_call: bool) -> Self
pub const fn set_tail_call(self, tail_call: bool) -> Self
Do not return from the call but rather return the result of the callee to the callers caller.
Note
This makes the current contract completely transparent to its caller by replacing this contracts potential output with the callee ones. Any code after the contract calls has been invoked can be safely considered unreachable.
sourcepub const fn set_allow_reentry(self, allow_reentry: bool) -> Self
pub const fn set_allow_reentry(self, allow_reentry: bool) -> Self
Allow the callee to reenter into the current contract.
Without this flag any reentrancy into the current contract that originates from the callee (or any of its callees) is denied. This includes the first callee: You cannot call into yourself with this flag set.
sourcepub const fn forward_input(&self) -> bool
pub const fn forward_input(&self) -> bool
sourcepub const fn clone_input(&self) -> bool
pub const fn clone_input(&self) -> bool
sourcepub const fn allow_reentry(&self) -> bool
pub const fn allow_reentry(&self) -> bool
Trait Implementations
impl Copy for CallFlags
Auto Trait Implementations
impl RefUnwindSafe for CallFlags
impl Send for CallFlags
impl Sync for CallFlags
impl Unpin for CallFlags
impl UnwindSafe for CallFlags
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more