pub struct RuleData {
pub ints: HashMap<&'static str, i64>,
pub bools: HashMap<&'static str, bool>,
pub strings: HashMap<&'static str, String>,
pub string_sets: HashMap<&'static str, HashSet<String>>,
}Expand description
Custom data storage for stateful rules.
Fields§
§ints: HashMap<&'static str, i64>Integer values.
bools: HashMap<&'static str, bool>Boolean values.
strings: HashMap<&'static str, String>String values.
string_sets: HashMap<&'static str, HashSet<String>>String set values.
Implementations§
Source§impl RuleData
impl RuleData
pub fn get_int(&self, key: &'static str) -> i64
pub fn set_int(&mut self, key: &'static str, value: i64)
pub fn get_bool(&self, key: &'static str) -> bool
pub fn set_bool(&mut self, key: &'static str, value: bool)
pub fn get_string(&self, key: &'static str) -> Option<&str>
pub fn set_string(&mut self, key: &'static str, value: impl Into<String>)
pub fn get_string_set(&self, key: &'static str) -> Option<&HashSet<String>>
pub fn insert_to_set(&mut self, key: &'static str, value: impl Into<String>)
pub fn set_contains(&self, key: &'static str, value: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleData
impl RefUnwindSafe for RuleData
impl Send for RuleData
impl Sync for RuleData
impl Unpin for RuleData
impl UnwindSafe for RuleData
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,
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> 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 moreCreates a shared type from an unshared type.