pub struct HookRecord {
pub on: String,
pub order: u32,
pub priority: i32,
pub chance: Option<Rational>,
pub ops: Vec<Op>,
}Expand description
One hook = one (event, ordering, gate, op-list) (doc 11 §1).
Fields§
§on: StringThe event name; parsed to the closed Event at load.
order: u32on<Event>Order; LOW first. Default u32::MAX (fires last).
priority: i32on<Event>Priority; HIGH first. Default 0.
chance: Option<Rational>Optional RNG gate [num, den]: the op-list runs only if
ctx.rng.chance(num, den) (doc 11 §4.1). The draw is consumed
unconditionally so draw order is a pure function of the op-list.
ops: Vec<Op>The closed primitive op-list.
Trait Implementations§
Source§impl Clone for HookRecord
impl Clone for HookRecord
Source§fn clone(&self) -> HookRecord
fn clone(&self) -> HookRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookRecord
impl Debug for HookRecord
Source§impl<'de> Deserialize<'de> for HookRecord
impl<'de> Deserialize<'de> for HookRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HookRecord
impl RefUnwindSafe for HookRecord
impl Send for HookRecord
impl Sync for HookRecord
impl Unpin for HookRecord
impl UnsafeUnpin for HookRecord
impl UnwindSafe for HookRecord
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