pub struct ContractRef<Database> { /* private fields */ }
Expand description
The wrapper around contract_id
to simplify work with Contract
in the database.
Implementations§
Source§impl<Database> ContractRef<Database>
impl<Database> ContractRef<Database>
pub fn new(database: Database, contract_id: ContractId) -> Self
pub fn contract_id(&self) -> &ContractId
pub fn database(&self) -> &Database
pub fn database_mut(&mut self) -> &mut Database
Source§impl<Database> ContractRef<Database>
impl<Database> ContractRef<Database>
Source§impl<Database> ContractRef<Database>
impl<Database> ContractRef<Database>
pub fn validated_utxo( &self, utxo_validation: bool, ) -> Result<<ContractsLatestUtxo as Mappable>::GetValue, Error>
Source§impl<Database> ContractRef<Database>
impl<Database> ContractRef<Database>
pub fn balance_root( &mut self, ) -> Result<Bytes32, <Database as StorageInspect<ContractsAssets<'_>>>::Error>
Source§impl<Database> ContractRef<Database>
impl<Database> ContractRef<Database>
pub fn state_root( &mut self, ) -> Result<Bytes32, <Database as StorageInspect<ContractsState<'_>>>::Error>
Trait Implementations§
Source§impl<'a, Database> GenesisCommitment for ContractRef<&'a mut Database>where
for<'b> Database: ContractStorageTrait<'a>,
impl<'a, Database> GenesisCommitment for ContractRef<&'a mut Database>where
for<'b> Database: ContractStorageTrait<'a>,
Source§fn root(&mut self) -> Result<MerkleRoot>
fn root(&mut self) -> Result<MerkleRoot>
Calculates the merkle root of the state of the entity.
Auto Trait Implementations§
impl<Database> Freeze for ContractRef<Database>where
Database: Freeze,
impl<Database> RefUnwindSafe for ContractRef<Database>where
Database: RefUnwindSafe,
impl<Database> Send for ContractRef<Database>where
Database: Send,
impl<Database> Sync for ContractRef<Database>where
Database: Sync,
impl<Database> Unpin for ContractRef<Database>where
Database: Unpin,
impl<Database> UnwindSafe for ContractRef<Database>where
Database: 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more