pub struct Issuer { /* private fields */ }
Expand description
An issuer contains information required for the creation of a contract and interaction with an existing contract.
§Invariance
The structure provides the following invariance guarantees:
- all the API codex matches the codex under which the contract was issued;
- all the API ids are unique;
- all custom APIs have unique names.
Implementations§
Source§impl Issuer
impl Issuer
pub fn load<E>( path: impl AsRef<Path>, sig_validator: impl FnOnce(StrictHash, &Identity, &SigBlob) -> Result<(), E>, ) -> Result<Self, DeserializeError>
Available on crate feature
binfile
only.pub fn save(&self, path: impl AsRef<Path>) -> Result<()>
Available on crate feature
binfile
only.Source§impl Issuer
impl Issuer
Sourcepub fn new(codex: Codex, semantics: Semantics) -> Result<Self, SemanticError>
pub fn new(codex: Codex, semantics: Semantics) -> Result<Self, SemanticError>
Construct issuer from a codex and its semantics.
Sourcepub fn with<E>(
codex: Codex,
semantics: Semantics,
sig: SigBlob,
sig_validator: impl FnOnce(StrictHash, &Identity, &SigBlob) -> Result<(), E>,
) -> Result<Self, SemanticError>
pub fn with<E>( codex: Codex, semantics: Semantics, sig: SigBlob, sig_validator: impl FnOnce(StrictHash, &Identity, &SigBlob) -> Result<(), E>, ) -> Result<Self, SemanticError>
Construct issuer from a codex and signed semantics.
pub fn dismember(self) -> (Codex, Semantics)
Sourcepub fn issuer_id(&self) -> IssuerId
pub fn issuer_id(&self) -> IssuerId
Compute an issuer id, which includes information about the codex id, API version and checksum.
Sourcepub fn codex_name(&self) -> &TinyString
pub fn codex_name(&self) -> &TinyString
Get the name of the underlying codex.
Sourcepub fn default_api(&self) -> &Api
pub fn default_api(&self) -> &Api
Get a reference to the default API.
Sourcepub fn custom_apis(&self) -> impl Iterator<Item = (&TypeName, &Api)>
pub fn custom_apis(&self) -> impl Iterator<Item = (&TypeName, &Api)>
Get an iterator over the custom APIs.
Sourcepub fn types(&self) -> &TypeSystem
pub fn types(&self) -> &TypeSystem
Get a reference to the type system.
Sourcepub fn apis(&self) -> impl Iterator<Item = &Api>
pub fn apis(&self) -> impl Iterator<Item = &Api>
Iterates over all APIs, including the default and the named ones.
Sourcepub fn codex_libs(&self) -> impl Iterator<Item = &Lib>
pub fn codex_libs(&self) -> impl Iterator<Item = &Lib>
Iterates over all codex libraries.
Source§impl Issuer
impl Issuer
pub fn start_issue( self, method: impl Into<MethodName>, consensus: Consensus, testnet: bool, ) -> IssueBuilder
pub fn start_issue_mainnet( self, method: impl Into<MethodName>, consensus: Consensus, ) -> IssueBuilder
pub fn start_issue_testnet( self, method: impl Into<MethodName>, consensus: Consensus, ) -> IssueBuilder
pub fn issue(self, params: IssueParams) -> Articles
Trait Implementations§
Source§impl StrictDumb for Issuer
impl StrictDumb for Issuer
fn strict_dumb() -> Self
Source§impl StrictEncode for Issuer
impl StrictEncode for Issuer
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for Issuer
impl StrictStruct for Issuer
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Issuer
impl StrictType for Issuer
const STRICT_LIB_NAME: &'static str = LIB_NAME_SONIC
fn strict_name() -> Option<TypeName>
impl Eq for Issuer
impl StrictProduct for Issuer
impl StructuralPartialEq for Issuer
Auto Trait Implementations§
impl Freeze for Issuer
impl RefUnwindSafe for Issuer
impl Send for Issuer
impl Sync for Issuer
impl Unpin for Issuer
impl UnwindSafe for Issuer
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.