Struct solana_runtime::accounts_index::ouroboros_impl_read_account_map_entry::ReadAccountMapEntryAsyncTryBuilder
source · pub(super) struct ReadAccountMapEntryAsyncTryBuilder<T: IndexValue, SlotListGuardBuilder_: for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>>, Error_> {
pub(super) owned_entry: Arc<AccountMapEntryInner<T>>,
pub(super) slot_list_guard_builder: SlotListGuardBuilder_,
}
Expand description
A more verbose but stable way to construct self-referencing structs. It is comparable to using StructName { field1: value1, field2: value2 }
rather than StructName::new(value1, value2)
. This has the dual benefit of makin your code both easier to refactor and more readable. Call try_build()
or try_build_or_recover()
to construct the actual struct. The fields of this struct should be used as follows:
Field | Suggested Use |
---|---|
owned_entry | Directly pass in the value this field should contain |
slot_list_guard_builder | Use a function or closure: (owned_entry: &_) -> Result<slot_list_guard: _, Error_> |
Fields§
§owned_entry: Arc<AccountMapEntryInner<T>>
§slot_list_guard_builder: SlotListGuardBuilder_
Implementations§
source§impl<T: IndexValue, SlotListGuardBuilder_: for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>>, Error_> ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>
impl<T: IndexValue, SlotListGuardBuilder_: for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>>, Error_> ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>
sourcepub(super) async fn try_build(self) -> Result<ReadAccountMapEntry<T>, Error_>
pub(super) async fn try_build(self) -> Result<ReadAccountMapEntry<T>, Error_>
Calls ReadAccountMapEntry::try_new()
using the provided values. This is preferrable over calling try_new()
directly for the reasons listed above.
sourcepub(super) async fn try_build_or_recover(
self
) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
pub(super) async fn try_build_or_recover( self ) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
Calls ReadAccountMapEntry::try_new_or_recover()
using the provided values. This is preferrable over calling try_new_or_recover()
directly for the reasons listed above.
Auto Trait Implementations§
impl<T, SlotListGuardBuilder_, Error_> RefUnwindSafe for ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>where SlotListGuardBuilder_: RefUnwindSafe,
impl<T, SlotListGuardBuilder_, Error_> Send for ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>where SlotListGuardBuilder_: Send,
impl<T, SlotListGuardBuilder_, Error_> Sync for ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>where SlotListGuardBuilder_: Sync,
impl<T, SlotListGuardBuilder_, Error_> Unpin for ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>where SlotListGuardBuilder_: Unpin,
impl<T, SlotListGuardBuilder_, Error_> UnwindSafe for ReadAccountMapEntryAsyncTryBuilder<T, SlotListGuardBuilder_, Error_>where SlotListGuardBuilder_: UnwindSafe,
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