pub enum UsageLimitRuleConfig {
Transaction {
max: u64,
window_seconds: Option<u64>,
},
Instruction {
program: String,
instruction: String,
max: u64,
window_seconds: Option<u64>,
},
}Expand description
Configuration for a single usage limit rule (TOML-serializable)
Use type field to specify the rule type:
type = "transaction"- Counts all transactionstype = "instruction"- Counts specific instruction types
Example TOML:
[[kora.usage_limit.rules]]
type = "transaction"
max = 100
window_seconds = 3600
[[kora.usage_limit.rules]]
type = "instruction"
program = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
instruction = "Transfer"
max = 10Variants§
Transaction
Transaction-level limit - counts all transactions for a wallet
Fields
Instruction
Instruction-level limit - counts specific instruction types
Implementations§
Trait Implementations§
Source§impl Clone for UsageLimitRuleConfig
impl Clone for UsageLimitRuleConfig
Source§fn clone(&self) -> UsageLimitRuleConfig
fn clone(&self) -> UsageLimitRuleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for UsageLimitRuleConfig
impl<'de> Deserialize<'de> for UsageLimitRuleConfig
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
Source§impl Serialize for UsageLimitRuleConfig
impl Serialize for UsageLimitRuleConfig
Auto Trait Implementations§
impl Freeze for UsageLimitRuleConfig
impl RefUnwindSafe for UsageLimitRuleConfig
impl Send for UsageLimitRuleConfig
impl Sync for UsageLimitRuleConfig
impl Unpin for UsageLimitRuleConfig
impl UnsafeUnpin for UsageLimitRuleConfig
impl UnwindSafe for UsageLimitRuleConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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.