Trait fav_core::status::SetsStatusExt

source ·
pub trait SetsStatusExt: Sets
where Self::Set: Status,
{ // Provided methods fn on_set_status(&mut self, status: StatusFlags) { ... } fn off_set_status(&mut self, status: StatusFlags) { ... } fn set_set_status(&mut self, status: StatusFlags) { ... } fn with_set_status_on(self, status: StatusFlags) -> Self where Self: Sized { ... } fn with_set_status_set(self, status: StatusFlags) -> Self where Self: Sized { ... } }
Expand description

Status Extension for Sets

§Example

use fav_core::status::{Status, SetStatusExt, StatusFlags};
let mut res_set = TestSet::default();
res_set.set.push(TestRes::default());
let res_set = res_set.with_res_status_on(StatusFlags::FETCHED);
assert!(res_set.set[0].check_status(StatusFlags::FETCHED));

Provided Methods§

source

fn on_set_status(&mut self, status: StatusFlags)

turn on StatusFlags to all resources

source

fn off_set_status(&mut self, status: StatusFlags)

set StatusFlags to all resources

source

fn set_set_status(&mut self, status: StatusFlags)

set StatusFlags to all resources

source

fn with_set_status_on(self, status: StatusFlags) -> Self
where Self: Sized,

turn on StatusFlags to all resources from old

source

fn with_set_status_set(self, status: StatusFlags) -> Self
where Self: Sized,

set StatusFlags to all resources from old

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> SetsStatusExt for T
where T: Sets, T::Set: Status,