Struct switchboard_solana::attestation_program::accounts::service_worker::ServiceWorkerAccountData
source · #[repr(packed(1))]pub struct ServiceWorkerAccountData {Show 17 fields
pub status: u8,
pub region: ServerRegion,
pub zone: ServerZone,
pub authority: Pubkey,
pub attestation_queue: Pubkey,
pub created_at: i64,
pub updated_at: i64,
pub permissions_required: BoolWithLock,
pub available_enclave_size: u64,
pub max_enclave_size: u64,
pub max_cpu: u64,
pub enclave_cost: u64,
pub reward_escrow: Pubkey,
pub services: [ServiceRow; 128],
pub services_len: u32,
pub max_services_len: u32,
pub _ebuf: [u8; 1024],
}
Expand description
A ServiceWorkerAccountData
represents a given server or kubernetes cluster that is ready to spin up new workloads.
Fields§
§status: u8
§region: ServerRegion
Trusted. The region the server will be run within.
zone: ServerZone
Trusted. The zone where the server will be run within.
Signer allowed to configure the service worker..
attestation_queue: Pubkey
The Attestation Queue for this service worker, responsible for verifying any SGX quotes.
created_at: i64
The unix timestamp when the quote was created.
updated_at: i64
The unix timestamp when the service was last updated.
permissions_required: BoolWithLock
Whether the service worker authority needs to approve new services to use the worker.
available_enclave_size: u64
The available amount of memory on the machine. Trusted to be set correctly by the service worker authority.
max_enclave_size: u64
The maximum amount of RAM available to run Trusted Execution Environments (TEEs).
max_cpu: u64
The maximum CPU that can be given to a service.
enclave_cost: u64
The cost to use this service worker. Should this be cost per epoch?
reward_escrow: Pubkey
The SwitchboardWallet account containing the reward escrow for verifying quotes on-chain. We should set this whenever the operator changes so we dont need to pass another account and can verify with has_one.
services: [ServiceRow; 128]
The addresses of the services who are being executed by the service worker.
services_len: u32
The length of valid services for the service worker.
max_services_len: u32
The maximum number of services allowed to run the service.
_ebuf: [u8; 1024]
Reserved.
Implementations§
source§impl ServiceWorkerAccountData
impl ServiceWorkerAccountData
pub fn size() -> usize
pub fn add_service( &mut self, service: &mut Account<'_, FunctionServiceAccountData> ) -> Result<()>
pub fn remove_service( &mut self, service: &mut Account<'_, FunctionServiceAccountData>, idx: usize ) -> Result<()>
pub fn find_service_idx( &self, service: Pubkey, function: Pubkey, idx: Option<u32> ) -> Result<usize>
source§impl ServiceWorkerAccountData
impl ServiceWorkerAccountData
pub fn fetch(client: &RpcClient, pubkey: Pubkey) -> Result<Self, SbError>
pub async fn fetch_async( client: &RpcClient, pubkey: Pubkey ) -> Result<Self, SbError>
pub fn fetch_sync<T: SyncClient>( client: &T, pubkey: Pubkey ) -> Result<Self, SbError>
sourcepub async fn fetch_services(
&self,
client: &RpcClient
) -> Result<Vec<ServiceRowWithData>, SbError>
pub async fn fetch_services( &self, client: &RpcClient ) -> Result<Vec<ServiceRowWithData>, SbError>
Fetch all services and account data for a given ServiceWorker
Trait Implementations§
source§impl AccountDeserialize for ServiceWorkerAccountData
impl AccountDeserialize for ServiceWorkerAccountData
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Mint
account into a token
Account
.source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
source§impl Clone for ServiceWorkerAccountData
impl Clone for ServiceWorkerAccountData
source§fn clone(&self) -> ServiceWorkerAccountData
fn clone(&self) -> ServiceWorkerAccountData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Discriminator for ServiceWorkerAccountData
impl Discriminator for ServiceWorkerAccountData
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
impl Copy for ServiceWorkerAccountData
impl Pod for ServiceWorkerAccountData
impl ZeroCopy for ServiceWorkerAccountData
Auto Trait Implementations§
impl RefUnwindSafe for ServiceWorkerAccountData
impl Send for ServiceWorkerAccountData
impl Sync for ServiceWorkerAccountData
impl Unpin for ServiceWorkerAccountData
impl UnwindSafe for ServiceWorkerAccountData
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
§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
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.