Struct solana_runtime::accounts_index::ouroboros_impl_read_account_map_entry::ReadAccountMapEntry
source · pub struct ReadAccountMapEntry<T: IndexValue> { /* private fields */ }
Expand description
The self-referencing struct.
Implementations§
source§impl<T: IndexValue> ReadAccountMapEntry<T>
impl<T: IndexValue> ReadAccountMapEntry<T>
sourcepub(super) fn new(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> RwLockReadGuard<'this, SlotList<T>>
) -> ReadAccountMapEntry<T>
pub(super) fn new( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> RwLockReadGuard<'this, SlotList<T>> ) -> ReadAccountMapEntry<T>
Constructs a new instance of this self-referential struct. (See also ReadAccountMapEntryBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | 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: _ |
sourcepub(super) async fn new_async(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + 'this>>
) -> ReadAccountMapEntry<T>
pub(super) async fn new_async( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + 'this>> ) -> ReadAccountMapEntry<T>
Constructs a new instance of this self-referential struct. (See also ReadAccountMapEntryAsyncBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | 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: _ |
sourcepub(super) async fn new_async_send(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + Send + 'this>>
) -> ReadAccountMapEntry<T>
pub(super) async fn new_async_send( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = RwLockReadGuard<'this, SlotList<T>>> + Send + 'this>> ) -> ReadAccountMapEntry<T>
Constructs a new instance of this self-referential struct. (See also ReadAccountMapEntryAsyncSendBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | 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: _ |
sourcepub(super) fn try_new<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Result<RwLockReadGuard<'this, SlotList<T>>, Error_>
) -> Result<ReadAccountMapEntry<T>, Error_>
pub(super) fn try_new<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Result<RwLockReadGuard<'this, SlotList<T>>, Error_> ) -> Result<ReadAccountMapEntry<T>, Error_>
(See also ReadAccountMapEntryTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | 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_> |
sourcepub(super) fn try_new_or_recover<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Result<RwLockReadGuard<'this, SlotList<T>>, Error_>
) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
pub(super) fn try_new_or_recover<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Result<RwLockReadGuard<'this, SlotList<T>>, Error_> ) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
(See also ReadAccountMapEntryTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | 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_> |
sourcepub(super) async fn try_new_async<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>>
) -> Result<ReadAccountMapEntry<T>, Error_>
pub(super) async fn try_new_async<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>> ) -> Result<ReadAccountMapEntry<T>, Error_>
(See also ReadAccountMapEntryAsyncTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | 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_> |
sourcepub(super) async fn try_new_or_recover_async<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>>
) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
pub(super) async fn try_new_or_recover_async<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + 'this>> ) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
(See also ReadAccountMapEntryAsyncTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | 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_> |
sourcepub(super) async fn try_new_async_send<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + Send + 'this>>
) -> Result<ReadAccountMapEntry<T>, Error_>
pub(super) async fn try_new_async_send<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + Send + 'this>> ) -> Result<ReadAccountMapEntry<T>, Error_>
(See also ReadAccountMapEntryAsyncSendTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | 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_> |
sourcepub(super) async fn try_new_or_recover_async_send<Error_>(
owned_entry: Arc<AccountMapEntryInner<T>>,
slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + Send + 'this>>
) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
pub(super) async fn try_new_or_recover_async_send<Error_>( owned_entry: Arc<AccountMapEntryInner<T>>, slot_list_guard_builder: impl for<'this> FnOnce(&'this Arc<AccountMapEntryInner<T>>) -> Pin<Box<dyn Future<Output = Result<RwLockReadGuard<'this, SlotList<T>>, Error_>> + Send + 'this>> ) -> Result<ReadAccountMapEntry<T>, (Error_, Heads<T>)>
(See also ReadAccountMapEntryAsyncSendTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | 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_> |
sourcepub(super) fn with_owned_entry<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(&'outer_borrow Arc<AccountMapEntryInner<T>>) -> ReturnType
) -> ReturnType
pub(super) fn with_owned_entry<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow Arc<AccountMapEntryInner<T>>) -> ReturnType ) -> ReturnType
Provides limited immutable access to owned_entry
. This method was generated because the contents of owned_entry
are immutably borrowed by other fields.
sourcepub(super) fn borrow_owned_entry<'this>(
&'this self
) -> &'this Arc<AccountMapEntryInner<T>>
pub(super) fn borrow_owned_entry<'this>( &'this self ) -> &'this Arc<AccountMapEntryInner<T>>
Provides limited immutable access to owned_entry
. This method was generated because the contents of owned_entry
are immutably borrowed by other fields.
sourcepub(super) fn with_slot_list_guard<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(&'outer_borrow RwLockReadGuard<'this, SlotList<T>>) -> ReturnType
) -> ReturnType
pub(super) fn with_slot_list_guard<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow RwLockReadGuard<'this, SlotList<T>>) -> ReturnType ) -> ReturnType
Provides an immutable reference to slot_list_guard
. This method was generated because slot_list_guard
is a tail field.
sourcepub(super) fn borrow_slot_list_guard<'this>(
&'this self
) -> &'this RwLockReadGuard<'this, SlotList<T>>
pub(super) fn borrow_slot_list_guard<'this>( &'this self ) -> &'this RwLockReadGuard<'this, SlotList<T>>
Provides an immutable reference to slot_list_guard
. This method was generated because slot_list_guard
is a tail field.
sourcepub(super) fn with_slot_list_guard_mut<'outer_borrow, ReturnType>(
&'outer_borrow mut self,
user: impl for<'this> FnOnce(&'outer_borrow mut RwLockReadGuard<'this, SlotList<T>>) -> ReturnType
) -> ReturnType
pub(super) fn with_slot_list_guard_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(&'outer_borrow mut RwLockReadGuard<'this, SlotList<T>>) -> ReturnType ) -> ReturnType
Provides a mutable reference to slot_list_guard
. This method was generated because slot_list_guard
is a tail field. No borrow_slot_list_guard_mut
function was generated because Rust’s borrow checker is currently unable to guarantee that such a method would be used safely.
sourcepub(super) fn with<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this, T>) -> ReturnType
) -> ReturnType
pub(super) fn with<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this, T>) -> ReturnType ) -> ReturnType
This method provides immutable references to all tail and immutably borrowed fields.
sourcepub(super) fn with_mut<'outer_borrow, ReturnType>(
&'outer_borrow mut self,
user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this, T>) -> ReturnType
) -> ReturnType
pub(super) fn with_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this, T>) -> ReturnType ) -> ReturnType
This method provides mutable references to all tail fields.
sourcepub(super) fn into_heads(self) -> Heads<T>
pub(super) fn into_heads(self) -> Heads<T>
This function drops all internally referencing fields and returns only the head fields of this struct.