pub struct ContractData<S>where
S: ContractStateRead,{
pub state: S,
pub schema: Schema,
pub types: TypeSystem,
pub info: ContractInfo,
}Expand description
Data of a contract.
Fields§
§state: S§schema: Schema§types: TypeSystem§info: ContractInfoImplementations§
Source§impl<S> ContractData<S>where
S: ContractStateRead,
impl<S> ContractData<S>where
S: ContractStateRead,
pub fn contract_id(&self) -> ContractId
Sourcepub fn global(
&self,
name: impl Into<FieldName>,
) -> impl Iterator<Item = StrictVal>
pub fn global( &self, name: impl Into<FieldName>, ) -> impl Iterator<Item = StrictVal>
§Panics
If data is corrupted.
Sourcepub fn global_raw(
&self,
type_id: GlobalStateType,
) -> impl Iterator<Item = StrictVal>
pub fn global_raw( &self, type_id: GlobalStateType, ) -> impl Iterator<Item = StrictVal>
§Panics
If data is corrupted.
pub fn rights<'c>( &'c self, name: impl Into<FieldName>, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<VoidState>> + 'c, ContractError>
pub fn rights_raw<'c>( &'c self, type_id: AssignmentType, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<VoidState>> + 'c, ContractError>
pub fn fungible<'c>( &'c self, name: impl Into<FieldName>, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<Amount>> + 'c, ContractError>
pub fn fungible_raw<'c>( &'c self, type_id: AssignmentType, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<Amount>> + 'c, ContractError>
pub fn data<'c>( &'c self, name: impl Into<FieldName>, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<RevealedData>> + 'c, ContractError>
pub fn data_raw<'c>( &'c self, type_id: AssignmentType, filter: impl AssignmentsFilter + 'c, ) -> Result<impl Iterator<Item = OutputAssignment<RevealedData>> + 'c, ContractError>
pub fn allocations<'c>( &'c self, filter: impl AssignmentsFilter + Copy + 'c, ) -> impl Iterator<Item = OutputAssignment<AllocatedState>> + 'c
pub fn outpoint_allocations( &self, outpoint: OutPoint, ) -> impl Iterator<Item = OutputAssignment<AllocatedState>>
pub fn history( &self, filter_outpoints: impl AssignmentsFilter + Clone, filter_witnesses: impl AssignmentsFilter + Clone, ) -> Vec<ContractOp>
pub fn history_fungible( &self, filter_outpoints: impl AssignmentsFilter, filter_witnesses: impl AssignmentsFilter, ) -> Vec<ContractOp>
pub fn history_rights( &self, filter_outpoints: impl AssignmentsFilter, filter_witnesses: impl AssignmentsFilter, ) -> Vec<ContractOp>
pub fn history_data( &self, filter_outpoints: impl AssignmentsFilter, filter_witnesses: impl AssignmentsFilter, ) -> Vec<ContractOp>
pub fn witness_info(&self, witness_id: Txid) -> Option<WitnessInfo>
Trait Implementations§
Source§impl<S> Clone for ContractData<S>where
S: Clone + ContractStateRead,
impl<S> Clone for ContractData<S>where
S: Clone + ContractStateRead,
Source§fn clone(&self) -> ContractData<S>
fn clone(&self) -> ContractData<S>
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<S> Debug for ContractData<S>where
S: Debug + ContractStateRead,
impl<S> Debug for ContractData<S>where
S: Debug + ContractStateRead,
Source§impl<S> PartialEq for ContractData<S>where
S: PartialEq + ContractStateRead,
impl<S> PartialEq for ContractData<S>where
S: PartialEq + ContractStateRead,
impl<S> Eq for ContractData<S>where
S: Eq + ContractStateRead,
impl<S> StructuralPartialEq for ContractData<S>where
S: ContractStateRead,
Auto Trait Implementations§
impl<S> Freeze for ContractData<S>where
S: Freeze,
impl<S> RefUnwindSafe for ContractData<S>where
S: RefUnwindSafe,
impl<S> Send for ContractData<S>where
S: Send,
impl<S> Sync for ContractData<S>where
S: Sync,
impl<S> Unpin for ContractData<S>where
S: Unpin,
impl<S> UnwindSafe for ContractData<S>where
S: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.