pub enum StreamRuleRepeat {
Once,
Always,
AfterTurns(u32),
}Expand description
repeat = "once" | "always" | { after_turns = N }.
Variants§
Once
Fire at most once per session.
Always
Fire on every match.
AfterTurns(u32)
Fire again once N user turns have passed since the last hit.
Implementations§
Source§impl StreamRuleRepeat
impl StreamRuleRepeat
pub fn is_always(&self) -> bool
Sourcepub fn parse(s: &str) -> Option<Self>
pub fn parse(s: &str) -> Option<Self>
once, always, after_turns = N, { after_turns: N }, or a bare N.
Sourcepub fn allows(self, last: Option<u64>, turn: u64) -> bool
pub fn allows(self, last: Option<u64>, turn: u64) -> bool
Whether a rule last fired at last may fire on user turn turn.
pub fn label(self) -> String
Trait Implementations§
Source§impl Clone for StreamRuleRepeat
impl Clone for StreamRuleRepeat
impl Copy for StreamRuleRepeat
Source§impl Debug for StreamRuleRepeat
impl Debug for StreamRuleRepeat
Source§impl Default for StreamRuleRepeat
impl Default for StreamRuleRepeat
Source§impl<'de> Deserialize<'de> for StreamRuleRepeat
impl<'de> Deserialize<'de> for StreamRuleRepeat
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
impl Eq for StreamRuleRepeat
Source§impl PartialEq for StreamRuleRepeat
impl PartialEq for StreamRuleRepeat
Source§impl Serialize for StreamRuleRepeat
impl Serialize for StreamRuleRepeat
impl StructuralPartialEq for StreamRuleRepeat
Auto Trait Implementations§
impl Freeze for StreamRuleRepeat
impl RefUnwindSafe for StreamRuleRepeat
impl Send for StreamRuleRepeat
impl Sync for StreamRuleRepeat
impl Unpin for StreamRuleRepeat
impl UnsafeUnpin for StreamRuleRepeat
impl UnwindSafe for StreamRuleRepeat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more