pub struct Frequency<'a> {
pub authority: &'a Pubkey,
}
Expand description
Constraint representing a comparison based on time between operations.
Currently not implemented. This constraint is planned check to ensure a certain
amount of time has passed. This rule will make use of the rule_set_state_pda
optional account passed into Validate
, and will require the optional
rule_authority
account to sign.
Fields§
The authority of the frequency account.
Implementations§
Source§impl<'a> Frequency<'a>
impl<'a> Frequency<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, RuleSetError>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, RuleSetError>
Deserialize a constraint from a byte array.
Trait Implementations§
Source§impl<'a> Constraint<'a> for Frequency<'a>
impl<'a> Constraint<'a> for Frequency<'a>
Source§fn constraint_type(&self) -> ConstraintType
fn constraint_type(&self) -> ConstraintType
Returns the type of the constraint.
Source§fn validate(
&self,
_accounts: &HashMap<Pubkey, &AccountInfo<'_>>,
_payload: &Payload,
_update_rule_state: bool,
_rule_set_state_pda: &Option<&AccountInfo<'_>>,
rule_authority: &Option<&AccountInfo<'_>>,
) -> RuleResult
fn validate( &self, _accounts: &HashMap<Pubkey, &AccountInfo<'_>>, _payload: &Payload, _update_rule_state: bool, _rule_set_state_pda: &Option<&AccountInfo<'_>>, rule_authority: &Option<&AccountInfo<'_>>, ) -> RuleResult
Validates the constraint condition.
Auto Trait Implementations§
impl<'a> Freeze for Frequency<'a>
impl<'a> RefUnwindSafe for Frequency<'a>
impl<'a> Send for Frequency<'a>
impl<'a> Sync for Frequency<'a>
impl<'a> Unpin for Frequency<'a>
impl<'a> UnwindSafe for Frequency<'a>
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> 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