Selector

Trait Selector 

Source
pub trait Selector<'w> {
    type Iter: Iterator;
    type Component: Component;

    // Required method
    fn borrow(container: &'w Container) -> Self::Iter;

    // Provided method
    fn matches(container: &'w Container) -> bool { ... }
}
Expand description

Trait defenition of Selector to control mutability of borrows

Required Associated Types§

Required Methods§

Source

fn borrow(container: &'w Container) -> Self::Iter

Provided Methods§

Source

fn matches(container: &'w Container) -> bool

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.

Implementations on Foreign Types§

Source§

impl<'w, C> Selector<'w> for &C
where C: Component,

Source§

type Iter = Iter<'w, C>

Source§

type Component = C

Source§

fn borrow(container: &'w Container) -> Self::Iter

Source§

impl<'w, C> Selector<'w> for &mut C
where C: Component,

Source§

type Iter = IterMut<'w, C>

Source§

type Component = C

Source§

fn borrow(container: &'w Container) -> Self::Iter

Implementors§