Sets

Trait Sets 

Source
pub trait Sets {
    type Set: Set;

    // Required methods
    fn iter(&self) -> impl Iterator<Item = &Self::Set>;
    fn iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Set>;

    // Provided method
    fn subset<F>(&mut self, filter: F) -> SubSets<'_, Self, F>
       where F: Fn(&Self::Set) -> bool,
             Self: Sized { ... }
}
Expand description

Relations owned by a resource sets.

Required Associated Types§

Source

type Set: Set

The resource set type in this sets

Required Methods§

Source

fn iter(&self) -> impl Iterator<Item = &Self::Set>

The &set that the resource sets contains.

Source

fn iter_mut(&mut self) -> impl Iterator<Item = &mut Self::Set>

The &mut set that the resource sets contains.

Provided Methods§

Source

fn subset<F>(&mut self, filter: F) -> SubSets<'_, Self, F>
where F: Fn(&Self::Set) -> bool, Self: Sized,

Get a subset of the resource sets.

§Example
let app = App::default();
let mut sets = TestSets::default();
let mut sub = sets.subset(|r| r.check_status(StatusFlags::TRACK));
app.batch_fetch_set(&mut sub, 8);

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§

Source§

impl<'a, SS, F> Sets for SubSets<'a, SS, F>
where SS: Sets + 'a, F: Fn(&SS::Set) -> bool,

Source§

type Set = <SS as Sets>::Set