Trait frame_support::traits::tokens::nonfungibles::InspectEnumerable
source · pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
fn collections() -> Box<dyn Iterator<Item = Self::CollectionId>>;
fn items(
collection: &Self::CollectionId
) -> Box<dyn Iterator<Item = Self::ItemId>>;
fn owned(
who: &AccountId
) -> Box<dyn Iterator<Item = (Self::CollectionId, Self::ItemId)>>;
fn owned_in_collection(
collection: &Self::CollectionId,
who: &AccountId
) -> Box<dyn Iterator<Item = Self::ItemId>>;
}
Expand description
Interface for enumerating items in existence or owned by a given account over many collections of NFTs.
Required Methods§
sourcefn collections() -> Box<dyn Iterator<Item = Self::CollectionId>>
fn collections() -> Box<dyn Iterator<Item = Self::CollectionId>>
Returns an iterator of the collections in existence.
sourcefn items(
collection: &Self::CollectionId
) -> Box<dyn Iterator<Item = Self::ItemId>>
fn items(
collection: &Self::CollectionId
) -> Box<dyn Iterator<Item = Self::ItemId>>
Returns an iterator of the items of a collection
in existence.
sourcefn owned(
who: &AccountId
) -> Box<dyn Iterator<Item = (Self::CollectionId, Self::ItemId)>>
fn owned(
who: &AccountId
) -> Box<dyn Iterator<Item = (Self::CollectionId, Self::ItemId)>>
Returns an iterator of the items of all collections owned by who
.
sourcefn owned_in_collection(
collection: &Self::CollectionId,
who: &AccountId
) -> Box<dyn Iterator<Item = Self::ItemId>>
fn owned_in_collection(
collection: &Self::CollectionId,
who: &AccountId
) -> Box<dyn Iterator<Item = Self::ItemId>>
Returns an iterator of the items of collection
owned by who
.