pub struct TransitionDef {
pub transition_id: u16,
pub name: String,
pub owned_inputs: Vec<StateTypeId>,
pub owned_outputs: Vec<StateTypeId>,
pub global_updates: Vec<StateTypeId>,
pub validation_script: Vec<u8>,
}Expand description
Transition definition in the schema
Defines what inputs a transition consumes, what outputs it produces, and what validation script must pass.
Fields§
§transition_id: u16Transition ID (unique within schema)
name: StringHuman-readable name
owned_inputs: Vec<StateTypeId>Expected owned input type IDs
owned_outputs: Vec<StateTypeId>Produced owned output type IDs
global_updates: Vec<StateTypeId>Updated global state type IDs
validation_script: Vec<u8>Validation script bytecode (executed by the VM)
Implementations§
Source§impl TransitionDef
impl TransitionDef
Sourcepub fn new(
transition_id: u16,
name: impl Into<String>,
owned_inputs: Vec<StateTypeId>,
owned_outputs: Vec<StateTypeId>,
global_updates: Vec<StateTypeId>,
validation_script: Vec<u8>,
) -> Self
pub fn new( transition_id: u16, name: impl Into<String>, owned_inputs: Vec<StateTypeId>, owned_outputs: Vec<StateTypeId>, global_updates: Vec<StateTypeId>, validation_script: Vec<u8>, ) -> Self
Create a new transition definition
Trait Implementations§
Source§impl Clone for TransitionDef
impl Clone for TransitionDef
Source§fn clone(&self) -> TransitionDef
fn clone(&self) -> TransitionDef
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 Debug for TransitionDef
impl Debug for TransitionDef
Source§impl<'de> Deserialize<'de> for TransitionDef
impl<'de> Deserialize<'de> for TransitionDef
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 PartialEq for TransitionDef
impl PartialEq for TransitionDef
Source§impl Serialize for TransitionDef
impl Serialize for TransitionDef
impl Eq for TransitionDef
impl StructuralPartialEq for TransitionDef
Auto Trait Implementations§
impl Freeze for TransitionDef
impl RefUnwindSafe for TransitionDef
impl Send for TransitionDef
impl Sync for TransitionDef
impl Unpin for TransitionDef
impl UnsafeUnpin for TransitionDef
impl UnwindSafe for TransitionDef
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