HoldingsOperations

Trait HoldingsOperations 

pub trait HoldingsOperations {
    // Required methods
    fn add(self, other: Self) -> Self
       where Self: Sized;
    fn sub(self, other: Self) -> Self
       where Self: Sized;
}
Expand description

Extension traits for NFT holdings operations

Required Methods§

fn add(self, other: Self) -> Self
where Self: Sized,

Adds NFTs from another Holdings to this one, returning a new collection that contains all NFTs from both collections.

This operation never fails since it’s always possible to add NFTs.

§Parameters
  • other - The NFT collection to add
§Returns

A new NFT collection containing all NFTs from both collections

fn sub(self, other: Self) -> Self
where Self: Sized,

Removes NFTs that are in another collection from this one, returning a new collection that contains only the NFTs that are unique to this collection.

This operation never fails even if the other collection contains NFTs that are not in this collection.

§Parameters
  • other - The NFT collection to subtract
§Returns

A new NFT collection containing the NFTs remaining after subtraction

Implementations on Foreign Types§

§

impl HoldingsOperations for BTreeSet<u64>

§

fn add(self, other: BTreeSet<u64>) -> BTreeSet<u64>

§

fn sub(self, other: BTreeSet<u64>) -> BTreeSet<u64>

Implementors§