pub struct CodeInfo {
pub kind: CodeType,
pub requires: Vec<(String, VariableType)>,
pub exposes: Vec<(String, VariableType)>,
pub inputs: Vec<VariableType>,
pub output: VariableType,
}
Expand description
Struct that represents information about a Code.
Note: There are only two possible types of code: Shard and Wire.
See the CodeType
enum for more information.
Fields§
§kind: CodeType
The type of code, either Shard or Wire.
requires: Vec<(String, VariableType)>
A list of variables that must be available to the code context before the code can be executed. Each variable is represented as a tuple of its name and its type.
exposes: Vec<(String, VariableType)>
A list of variables that are available in the code context. Each variable is represented as a tuple of its name and its type.
inputs: Vec<VariableType>
A list of variable types that are inputted into the code.
output: VariableType
The variable type of the output generated by the code.
Trait Implementations§
source§impl Decode for CodeInfo
impl Decode for CodeInfo
source§impl<'de> Deserialize<'de> for CodeInfo
impl<'de> Deserialize<'de> for CodeInfo
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode for CodeInfo
impl Encode for CodeInfo
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 size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> 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