Struct shadow_drive_rust::models::StorageAccount
source · [−]pub struct StorageAccount {Show 18 fields
pub is_static: bool,
pub init_counter: u32,
pub del_counter: u32,
pub immutable: bool,
pub to_be_deleted: bool,
pub delete_request_epoch: u32,
pub storage: u64,
pub storage_available: u64,
pub owner_1: Pubkey,
pub owner_2: Pubkey,
pub shdw_payer: Pubkey,
pub account_counter_seed: u32,
pub total_cost_of_current_storage: u64,
pub total_fees_paid: u64,
pub creation_time: u32,
pub creation_epoch: u32,
pub last_fee_epoch: u32,
pub identifier: String,
}Fields
is_static: boolImmutable boolean to track what kind of storage account this is. NOTE: Not used in current implementation w/ non-dynamic storage payments
init_counter: u32Flag on whether storage account is public (usable by anyone) Counter tracking how many files have been initialized
del_counter: u32Counter tracking how many files have been deleted
immutable: boolBoolean to track whether storage account (and all child File accounts) are immutable
to_be_deleted: boolDelete flag
delete_request_epoch: u32Delete request epoch
storage: u64Number of bytes of storage associated with this account
storage_available: u64Bytes available for use
owner_1: PubkeyPrimary owner of StorageAccount (immutable)
owner_2: PubkeyOptional owner 2
shdw_payer: PubkeyPubkey of the token account that staked SHDW
account_counter_seed: u32Counter at time of initialization
total_cost_of_current_storage: u64Total shades paid for current box size
total_fees_paid: u64creation_time: u32Time of storage account creation
creation_epoch: u32Time of storage account creation
last_fee_epoch: u32The last epoch through which the user paid
identifier: StringSome unique identifier that the user provides. Serves as a seed for storage account PDA.
Implementations
sourceimpl StorageAccount
impl StorageAccount
pub fn increment_init_counter(&mut self)
pub fn increment_del_counter(&mut self)
Trait Implementations
sourceimpl AccountDeserialize for StorageAccount
impl AccountDeserialize for StorageAccount
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<StorageAccount, Error>
fn try_deserialize(buf: &mut &[u8]) -> Result<StorageAccount, Error>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a Mint account into a token
Account. Read more
sourcefn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<StorageAccount, Error>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<StorageAccount, Error>
Deserializes account data without checking the account discriminator. This should only be used on account initialization, when the bytes of the account are zeroed. Read more
sourceimpl AccountSerialize for StorageAccount
impl AccountSerialize for StorageAccount
sourceimpl BorshDeserialize for StorageAccount where
bool: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
Pubkey: BorshDeserialize,
String: BorshDeserialize,
impl BorshDeserialize for StorageAccount where
bool: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
Pubkey: BorshDeserialize,
String: BorshDeserialize,
sourcefn deserialize(buf: &mut &[u8]) -> Result<StorageAccount, Error>
fn deserialize(buf: &mut &[u8]) -> Result<StorageAccount, Error>
Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
sourceimpl BorshSerialize for StorageAccount where
bool: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
Pubkey: BorshSerialize,
String: BorshSerialize,
impl BorshSerialize for StorageAccount where
bool: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
Pubkey: BorshSerialize,
String: BorshSerialize,
sourceimpl Clone for StorageAccount
impl Clone for StorageAccount
sourcefn clone(&self) -> StorageAccount
fn clone(&self) -> StorageAccount
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Discriminator for StorageAccount
impl Discriminator for StorageAccount
fn discriminator() -> [u8; 8]
sourceimpl Owner for StorageAccount
impl Owner for StorageAccount
Auto Trait Implementations
impl RefUnwindSafe for StorageAccount
impl Send for StorageAccount
impl Sync for StorageAccount
impl Unpin for StorageAccount
impl UnwindSafe for StorageAccount
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more