Struct scrypto::resource::resource_builder::ResourceBuilder
source · 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()
ormint_initial_supply(..)
.
Example
use scrypto::prelude::*;
let bucket = ResourceBuilder::new_fungible(OwnerRole::None)
.mint_initial_supply(5);
Implementations§
source§impl ResourceBuilder
impl ResourceBuilder
sourcepub fn new_fungible(
owner_role: OwnerRole
) -> InProgressResourceBuilder<FungibleResourceType>
pub fn new_fungible( owner_role: OwnerRole ) -> InProgressResourceBuilder<FungibleResourceType>
Starts a new builder to create a fungible resource.
sourcepub fn new_string_non_fungible<D: NonFungibleData>(
owner_role: OwnerRole
) -> InProgressResourceBuilder<NonFungibleResourceType<StringNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>
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
sourcepub fn new_integer_non_fungible<D: NonFungibleData>(
owner_role: OwnerRole
) -> InProgressResourceBuilder<NonFungibleResourceType<IntegerNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>
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
sourcepub fn new_bytes_non_fungible<D: NonFungibleData>(
owner_role: OwnerRole
) -> InProgressResourceBuilder<NonFungibleResourceType<BytesNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>
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
sourcepub fn new_ruid_non_fungible<D: NonFungibleData>(
owner_role: OwnerRole
) -> InProgressResourceBuilder<NonFungibleResourceType<RUIDNonFungibleLocalId, D, FixedEnumVariant<NON_FUNGIBLE_DATA_SCHEMA_VARIANT_LOCAL, LocalNonFungibleDataSchema>>>
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§
impl RefUnwindSafe for ResourceBuilder
impl Send for ResourceBuilder
impl Sync for ResourceBuilder
impl Unpin for ResourceBuilder
impl UnwindSafe for ResourceBuilder
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<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 moresource§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