pub enum Program<BlockNumber: Copy> {
Active(ActiveProgram<BlockNumber>),
Exited(ProgramId),
Terminated(ProgramId),
}
Expand description
Program in different states in storage.
Variants§
Active(ActiveProgram<BlockNumber>)
Program in active state.
Exited(ProgramId)
Program has been exited (gr_exit was called)
Terminated(ProgramId)
Program has been terminated (init
was failed)
Implementations§
Source§impl<BlockNumber: Copy> Program<BlockNumber>
impl<BlockNumber: Copy> Program<BlockNumber>
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Returns whether the program is terminated.
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Returns whether the program is active and initialized.
Trait Implementations§
Source§impl<BlockNumber: Copy> Decode for Program<BlockNumber>where
ActiveProgram<BlockNumber>: Decode,
impl<BlockNumber: Copy> Decode for Program<BlockNumber>where
ActiveProgram<BlockNumber>: Decode,
Source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>
Attempt to deserialise the value from input.
Source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§impl<BlockNumber: Copy> Encode for Program<BlockNumber>where
ActiveProgram<BlockNumber>: Encode,
impl<BlockNumber: Copy> Encode for Program<BlockNumber>where
ActiveProgram<BlockNumber>: Encode,
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Convert self to a slice and append it to the destination.
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
impl<BlockNumber: Copy> EncodeLike for Program<BlockNumber>where
ActiveProgram<BlockNumber>: Encode,
impl<BlockNumber: Eq + Copy> Eq for Program<BlockNumber>
impl<BlockNumber: Copy> StructuralPartialEq for Program<BlockNumber>
Auto Trait Implementations§
impl<BlockNumber> Freeze for Program<BlockNumber>where
BlockNumber: Freeze,
impl<BlockNumber> RefUnwindSafe for Program<BlockNumber>where
BlockNumber: RefUnwindSafe,
impl<BlockNumber> Send for Program<BlockNumber>where
BlockNumber: Send,
impl<BlockNumber> Sync for Program<BlockNumber>where
BlockNumber: Sync,
impl<BlockNumber> Unpin for Program<BlockNumber>where
BlockNumber: Unpin,
impl<BlockNumber> UnwindSafe for Program<BlockNumber>where
BlockNumber: 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
Mutably borrows from an owned value. Read more