Struct solana_runtime::append_vec::AppendVec[][src]

pub struct AppendVec { /* fields omitted */ }

A thread-safe, file-backed block of memory used to store Account instances. Append operations are serialized such that only one thread updates the internal append_lock at a time. No restrictions are placed on reading. That is, one may read items from one thread while another is appending new items.

Implementations

impl AppendVec[src]

pub fn new(file: &Path, create: bool, size: usize) -> Self[src]

pub fn set_no_remove_on_drop(&mut self)[src]

pub fn new_empty_map(current_len: usize) -> Self[src]

pub fn flush(&self) -> Result<()>[src]

pub fn reset(&self)[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn capacity(&self) -> u64[src]

pub fn file_name(slot: Slot, id: usize) -> String[src]

pub fn new_from_file<P: AsRef<Path>>(
    path: P,
    current_len: usize
) -> Result<(Self, usize)>
[src]

pub fn get_account<'a>(
    &'a self,
    offset: usize
) -> Option<(StoredAccountMeta<'a>, usize)>
[src]

Return account metadata for the account at offset if its data doesn’t overrun the internal buffer. Otherwise return None. Also return the offset of the first byte after the requested data that falls on a 64-byte boundary.

pub fn get_account_test(
    &self,
    offset: usize
) -> Option<(StoredMeta, AccountSharedData)>
[src]

pub fn get_path(&self) -> PathBuf[src]

pub fn accounts(&self, offset: usize) -> Vec<StoredAccountMeta<'_>>[src]

Return account metadata for each account, starting from offset.

pub fn append_accounts(
    &self,
    accounts: &[(StoredMeta, &AccountSharedData)],
    hashes: &[Hash]
) -> Vec<usize>
[src]

Copy each account metadata, account and hash to the internal buffer. Return the starting offset of each account metadata. After each account is appended, the internal current_len is updated and will be available to other threads.

pub fn append_account(
    &self,
    storage_meta: StoredMeta,
    account: &AccountSharedData,
    hash: Hash
) -> Option<usize>
[src]

Copy the account metadata, account and hash to the internal buffer. Return the starting offset of the account metadata. After the account is appended, the internal current_len is updated.

Trait Implementations

impl AbiExample for AppendVec[src]

fn example() -> Self[src]

impl Debug for AppendVec[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for AppendVec[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> AbiExample for T[src]

pub default fn example() -> T[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V