CardCollection

Trait CardCollection 

Source
pub trait CardCollection
where Self: Sized,
{ // Required methods fn add_card(&self, card: Card) -> Result<Self, ()>; fn pop_card(&self) -> Vec<(Self, Card)>; }

Required Methods§

Source

fn add_card(&self, card: Card) -> Result<Self, ()>

Creates a copy of the CardCollection, but with an additional card added. Fails if the card cannot be put into the collection.

Source

fn pop_card(&self) -> Vec<(Self, Card)>

Creates all possible versions of the CardCollection where one card has been removed. Each returned CardCollection is paired with the removed card. If no card can be removed according to the rules, an empty Vec is returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§