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) -> Selfwhere
Self: Sized,
fn add(self, other: Self) -> Selfwhere
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) -> Selfwhere
Self: Sized,
fn sub(self, other: Self) -> Selfwhere
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