pub struct ResourceBuilder;
Expand description

Utility for setting up a new resource.

  • You start the building process with one of the methods starting with new_.
  • The allowed methods change depending on which methods have already been called. For example, you can either use owner_non_fungible_badge or set access rules individually, but not both.
  • You can complete the building process using either create_with_no_initial_supply() or mint_initial_supply(..).

Example

use scrypto::prelude::*;

let bucket = ResourceBuilder::new_fungible(OwnerRole::None)
    .mint_initial_supply(5);

Implementations§

source§

impl ResourceBuilder

source

pub fn new_fungible( owner_role: OwnerRole ) -> InProgressResourceBuilder<FungibleResourceType>

Starts a new builder to create a fungible resource.

source

pub fn new_string_non_fungible<D: NonFungibleData>( owner_role: OwnerRole ) -> InProgressResourceBuilder<NonFungibleResourceType<StringNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>

Starts a new builder to create a non-fungible resource with a NonFungibleIdType::String

source

pub fn new_integer_non_fungible<D: NonFungibleData>( owner_role: OwnerRole ) -> InProgressResourceBuilder<NonFungibleResourceType<IntegerNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>

Starts a new builder to create a non-fungible resource with a NonFungibleIdType::Integer

source

pub fn new_bytes_non_fungible<D: NonFungibleData>( owner_role: OwnerRole ) -> InProgressResourceBuilder<NonFungibleResourceType<BytesNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>

Starts a new builder to create a non-fungible resource with a NonFungibleIdType::Bytes

source

pub fn new_ruid_non_fungible<D: NonFungibleData>( owner_role: OwnerRole ) -> InProgressResourceBuilder<NonFungibleResourceType<RUIDNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>

Starts a new builder to create a non-fungible resource with a NonFungibleIdType::RUID

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> Twhere T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V