Struct solana_runtime::accounts_index::ouroboros_impl_read_account_map_entry::ReadAccountMapEntryAsyncSendBuilder
source · pub(super) struct ReadAccountMapEntryAsyncSendBuilder<T: IndexValue, SlotListGuardBuilder_: for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + Send + 'this>>> {
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 making your code both easier to refactor and more readable. Call build()
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: &_) -> slot_list_guard: _ |
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 = RwLockReadGuard<'this, SlotList<T>>> + Send + 'this>>> ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>
impl<T: IndexValue, SlotListGuardBuilder_: for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + Send + 'this>>> ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>
sourcepub(super) async fn build(self) -> ReadAccountMapEntry<T>
pub(super) async fn build(self) -> ReadAccountMapEntry<T>
Calls ReadAccountMapEntry::new()
using the provided values. This is preferrable over calling new()
directly for the reasons listed above.
Auto Trait Implementations§
impl<T, SlotListGuardBuilder_> RefUnwindSafe for ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>where SlotListGuardBuilder_: RefUnwindSafe,
impl<T, SlotListGuardBuilder_> Send for ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>where SlotListGuardBuilder_: Send,
impl<T, SlotListGuardBuilder_> Sync for ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>where SlotListGuardBuilder_: Sync,
impl<T, SlotListGuardBuilder_> Unpin for ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>where SlotListGuardBuilder_: Unpin,
impl<T, SlotListGuardBuilder_> UnwindSafe for ReadAccountMapEntryAsyncSendBuilder<T, SlotListGuardBuilder_>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