Struct stremio_core::runtime::Effects
source · pub struct Effects {
effects: Vec<Effect>,
pub has_changed: bool,
}
Expand description
§Examples
use stremio_core::runtime::Effects;
let none_unchanged = Effects::none().unchanged();
let default = Effects::default();
assert_eq!(default.has_changed, false);
assert!(none_unchanged.is_empty());
assert!(default.is_empty());
assert_eq!(none_unchanged.has_changed, default.has_changed);
Fields§
§effects: Vec<Effect>
The effects to be applied
has_changed: bool
Whether or not the effects are changing something in the Model
.
When has_changed == true
it will mark the given model field
as changed and add effect for it.
This will trigger a RuntimeEvent::NewState
for the Model
with all it’s changed fields.
Implementations§
source§impl Effects
impl Effects
pub fn none() -> Self
pub fn one(effect: Effect) -> Self
pub fn many(effects: Vec<Effect>) -> Self
pub fn msg(msg: Msg) -> Self
pub fn future(future: EffectFuture) -> Self
pub fn msgs(msgs: Vec<Msg>) -> Self
pub fn futures(futures: Vec<EffectFuture>) -> Self
pub fn join(self, effects: Effects) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Effects
impl !RefUnwindSafe for Effects
impl !Send for Effects
impl !Sync for Effects
impl Unpin for Effects
impl !UnwindSafe for Effects
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more