#[repr(packed)]pub struct FunctionAccountData {Show 28 fields
pub is_scheduled: u8,
pub is_triggered: u8,
pub permissions: u32,
pub status: FunctionStatus,
pub name: [u8; 64],
pub metadata: [u8; 256],
pub created_at: i64,
pub updated_at: i64,
pub container_registry: [u8; 64],
pub container: [u8; 64],
pub version: [u8; 32],
pub authority: Pubkey,
pub escrow: Pubkey,
pub address_lookup_table: Pubkey,
pub attestation_queue: Pubkey,
pub queue_idx: u32,
pub schedule: [u8; 64],
pub last_execution_timestamp: i64,
pub next_allowed_timestamp: i64,
pub trigger_count: u64,
pub permission_expiration: i64,
pub num_requests: u64,
pub requests_disabled: bool,
pub requests_require_authorization: bool,
pub requests_default_slots_until_expiration: u64,
pub requests_fee: u64,
pub mr_enclaves: [[u8; 32]; 32],
pub _ebuf: [u8; 1024],
}Fields§
§is_scheduled: u8Whether the function is invoked on a schedule or by request
is_triggered: u8Whether the function has been manually triggered with the function_trigger instruction
permissions: u32The function permissions granted by the attestation_queue.authority
status: FunctionStatus§name: [u8; 64]The name of the function for easier identification.
metadata: [u8; 256]The metadata of the function for easier identification.
created_at: i64The unix timestamp when the function was created.
updated_at: i64The unix timestamp when the function config (container, registry, version, or schedule) was changed.
container_registry: [u8; 64]The off-chain registry to fetch the function container from.
container: [u8; 64]The identifier of the container in the given container_registry.
version: [u8; 32]The version tag of the container to pull.
The authority of the function which is authorized to make account changes.
escrow: PubkeyThe wrapped SOL escrow of the function to pay for scheduled requests.
address_lookup_table: PubkeyThe address_lookup_table of the function used to increase the number of accounts we can fit into a function result.
attestation_queue: PubkeyThe address of the AttestationQueueAccountData that will be processing function requests and verifying the function measurements.
queue_idx: u32An incrementer used to rotate through an AttestationQueue’s verifiers.
schedule: [u8; 64]The cron schedule to run the function on.
last_execution_timestamp: i64The unix timestamp when the function was last run.
next_allowed_timestamp: i64The unix timestamp when the function is allowed to run next.
trigger_count: u64The number of times to trigger the function upon the next invocation.
permission_expiration: i64UNUSED. The unix timestamp when the current permissions expire.
num_requests: u64Number of requests created for this function. Used to prevent closing when there are live requests.
requests_disabled: boolWhether custom requests have been disabled for this function.
Whether new requests need to be authorized by the FunctionAccount authority before being initialized. Useful if you want to use CPIs to control request account creation.
requests_default_slots_until_expiration: u64The number of slots after a request has been verified before allowing a non-authority account to close the account. Useful if you want to submit multiple txns in your custom function and need the account to be kept alive for multiple slots.
requests_fee: u64The lamports paid to the FunctionAccount escrow on each successful update request.
mr_enclaves: [[u8; 32]; 32]An array of permitted mr_enclave measurements for the function.
_ebuf: [u8; 1024]Reserved.
Implementations§
source§impl FunctionAccountData
impl FunctionAccountData
pub fn size() -> usize
sourcepub fn new<'info>(
function_account_info: &'info AccountInfo<'info>
) -> Result<Ref<'info, FunctionAccountData>>
pub fn new<'info>( function_account_info: &'info AccountInfo<'info> ) -> Result<Ref<'info, FunctionAccountData>>
sourcepub fn new_from_bytes(data: &[u8]) -> Result<&FunctionAccountData>
pub fn new_from_bytes(data: &[u8]) -> Result<&FunctionAccountData>
pub fn get_enclave_pda(fn_key: &Pubkey) -> Pubkey
pub fn get_escrow_key(fn_key: &Pubkey) -> Pubkey
sourcepub fn validate_enclave<'a>(
function_account_info: &AccountInfo<'a>,
enclave_account_info: &AccountInfo<'a>,
signer: &AccountInfo<'a>
) -> Result<bool>
pub fn validate_enclave<'a>( function_account_info: &AccountInfo<'a>, enclave_account_info: &AccountInfo<'a>, signer: &AccountInfo<'a> ) -> Result<bool>
Validate that the provided accounts correspond to the expected function accounts
Arguments
function_account_info- Solana AccountInfo for a FunctionAccountDataenclave_account_info- Solana AccountInfo for a EnclaveAccountDatasigner- Solana AccountInfo for a signer
pub fn is_empty_schedule(&self) -> bool
pub fn get_container(&self) -> String
pub fn get_version(&self) -> String
pub fn get_name(&self) -> String
pub fn is_valid_enclave(&self, mr_enclave: &[u8; 32]) -> bool
pub fn get_schedule(&self) -> Option<Schedule>
target_os="solana" only.pub fn get_last_execution_datetime(&self) -> DateTime<Utc>
target_os="solana" only.pub fn get_next_execution_datetime(&self) -> DateTime<Utc>
target_os="solana" only.pub fn should_execute(&self, now: DateTime<Utc>) -> bool
target_os="solana" only.pub async fn fetch(client: &RpcClient, pubkey: Pubkey) -> Result<Self, Error>
target_os="solana" only.Trait Implementations§
source§impl Clone for FunctionAccountData
impl Clone for FunctionAccountData
source§fn clone(&self) -> FunctionAccountData
fn clone(&self) -> FunctionAccountData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for FunctionAccountData
impl Debug for FunctionAccountData
source§impl Discriminator for FunctionAccountData
impl Discriminator for FunctionAccountData
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl PartialEq<FunctionAccountData> for FunctionAccountData
impl PartialEq<FunctionAccountData> for FunctionAccountData
source§fn eq(&self, other: &FunctionAccountData) -> bool
fn eq(&self, other: &FunctionAccountData) -> bool
self and other values to be equal, and is used
by ==.impl Copy for FunctionAccountData
impl Pod for FunctionAccountData
impl StructuralPartialEq for FunctionAccountData
impl ZeroCopy for FunctionAccountData
Auto Trait Implementations§
impl RefUnwindSafe for FunctionAccountData
impl Send for FunctionAccountData
impl Sync for FunctionAccountData
impl Unpin for FunctionAccountData
impl UnwindSafe for FunctionAccountData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§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
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.