pub struct Method { /* private fields */ }Expand description
A method that is constructed using nested calls.
Implementations§
Source§impl Method
impl Method
Sourcepub fn name<S: Into<String>>(self, name: S) -> Self
pub fn name<S: Into<String>>(self, name: S) -> Self
Put a name for the method. Setting a name on the method makes the CallHandler for this method skip this method if it’s trying to make a call to a method with a different name.
§Panics
If the method already has a name.
Sourcepub fn cycles_consume_all(self) -> Self
pub fn cycles_consume_all(self) -> Self
Make the method consume all of the cycles provided to it.
Sourcepub fn cycles_consume(self, cycles: u64) -> Self
pub fn cycles_consume(self, cycles: u64) -> Self
Make the method consume at most the given amount of cycles.
Sourcepub fn cycles_refund(self, cycles: u64) -> Self
pub fn cycles_refund(self, cycles: u64) -> Self
Make the method refund the given amount of cycles.
Sourcepub fn expect_arguments<T: ArgumentEncoder>(self, arguments: T) -> Self
pub fn expect_arguments<T: ArgumentEncoder>(self, arguments: T) -> Self
Make the method expect the given value as the argument, this method makes the method panic if it’s called with an argument other than what is provided.
§Panics
If called more than once.
Sourcepub fn expect_cycles(self, cycles: u64) -> Self
pub fn expect_cycles(self, cycles: u64) -> Self
Create a method that expects this amount of cycles to be sent to it.
§Panics
If called more than once on a method.
Sourcepub fn response<T: CandidType>(self, value: T) -> Self
pub fn response<T: CandidType>(self, value: T) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
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