SetStatusExt

Trait SetStatusExt 

Source
pub trait SetStatusExt: Set {
    // Provided methods
    fn on_res_status(&mut self, status: StatusFlags) { ... }
    fn off_res_status(&mut self, status: StatusFlags) { ... }
    fn set_res_status(&mut self, status: StatusFlags) { ... }
    fn with_res_status_on(self, status: StatusFlags) -> Self
       where Self: Sized { ... }
    fn with_res_status_set(self, status: StatusFlags) -> Self
       where Self: Sized { ... }
}
Expand description

Status Extension for Set

§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_res_status(&mut self, status: StatusFlags)

turn on StatusFlags to all resources

Source

fn off_res_status(&mut self, status: StatusFlags)

set StatusFlags to all resources

Source

fn set_res_status(&mut self, status: StatusFlags)

set StatusFlags to all resources

Source

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

turn on StatusFlags to all resources from old

Source

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

set StatusFlags to all resources from old

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<S> SetStatusExt for S
where S: Set,