pub struct RuleSetV2<'a> {
pub owner: &'a Pubkey,
pub rule_set_name: &'a Str32,
pub operations: &'a [Str32],
pub rules: Vec<RuleV2<'a>>,
/* private fields */
}
Expand description
The struct containing all Rule Set data, most importantly the map of operations to Rules
.
See top-level module for description of PDA memory layout.
Fields§
§owner: &'a Pubkey
Owner (creator) of the RuleSet.
rule_set_name: &'a Str32
Name of the RuleSet, used in PDA derivation.
operations: &'a [Str32]
Operations available.
rules: Vec<RuleV2<'a>>
Rules for each operation.
Implementations§
Source§impl<'a> RuleSetV2<'a>
impl<'a> RuleSetV2<'a>
Sourcepub fn from_bytes(bytes: &'a [u8]) -> Result<Self, RuleSetError>
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, RuleSetError>
Deserialize a RuleSetV2
from a byte array.
Trait Implementations§
Source§impl<'a> RuleSet<'a> for RuleSetV2<'a>
impl<'a> RuleSet<'a> for RuleSetV2<'a>
Source§fn get_rule(
&self,
operation: String,
) -> Result<&dyn Assertable<'a>, ProgramError>
fn get_rule( &self, operation: String, ) -> Result<&dyn Assertable<'a>, ProgramError>
This function returns the rule for an operation by recursively searching through fallbacks
Source§fn lib_version(&self) -> u8
fn lib_version(&self) -> u8
Returns the version of the
RuleSet
.Auto Trait Implementations§
impl<'a> Freeze for RuleSetV2<'a>
impl<'a> !RefUnwindSafe for RuleSetV2<'a>
impl<'a> !Send for RuleSetV2<'a>
impl<'a> !Sync for RuleSetV2<'a>
impl<'a> Unpin for RuleSetV2<'a>
impl<'a> !UnwindSafe for RuleSetV2<'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