pub struct FXProxyAsync<B>where
B: FXBuilderWrapperAsync,{ /* private fields */ }
Expand description
Container type for lazy fields
Implementations§
Source§impl<B, E> FXProxyAsync<B>where
B: FXBuilderWrapperAsync<Error = E>,
E: Debug,
impl<B, E> FXProxyAsync<B>where
B: FXBuilderWrapperAsync<Error = E>,
E: Debug,
Sourcepub fn into_inner(self) -> Option<B::Value>
pub fn into_inner(self) -> Option<B::Value>
Consumes the container, returns the wrapped value or None if the container is empty
Sourcepub async fn lazy_init<'a>(&'a self, owner: &B::Owner)
pub async fn lazy_init<'a>(&'a self, owner: &B::Owner)
Initialize the field without obtaining the lock by calling code. Note though that internally the lock is still required.
Sourcepub async fn read<'a>(
&'a self,
owner: &B::Owner,
) -> RwLockReadGuard<'a, B::Value>
pub async fn read<'a>( &'a self, owner: &B::Owner, ) -> RwLockReadGuard<'a, B::Value>
Lazy-initialize the field if necessary and return lock read guard for the inner value.
Panics if fallible field builder returns an error.
Sourcepub async fn read_mut<'a>(
&'a self,
owner: &B::Owner,
) -> RwLockMappedWriteGuard<'a, B::Value>
pub async fn read_mut<'a>( &'a self, owner: &B::Owner, ) -> RwLockMappedWriteGuard<'a, B::Value>
Lazy-initialize the field if necessary and return lock write guard for the inner value.
Panics if fallible field builder returns an error.
Sourcepub async fn try_read<'a>(
&'a self,
owner: &B::Owner,
) -> Result<RwLockReadGuard<'a, B::Value>, B::Error>
pub async fn try_read<'a>( &'a self, owner: &B::Owner, ) -> Result<RwLockReadGuard<'a, B::Value>, B::Error>
Lazy-initialize the field if necessary and return lock read guard for the inner value.
Return the same error, as fallible field builder if it errors out.
Sourcepub async fn try_read_mut<'a>(
&'a self,
owner: &B::Owner,
) -> Result<RwLockMappedWriteGuard<'a, B::Value>, B::Error>
pub async fn try_read_mut<'a>( &'a self, owner: &B::Owner, ) -> Result<RwLockMappedWriteGuard<'a, B::Value>, B::Error>
Lazy-initialize the field if necessary and return lock write guard for the inner value.
Return the same error, as fallible field builder if it errors out.
Sourcepub async fn write<'a>(&'a self) -> FXWrLockGuardAsync<'a, B>
pub async fn write<'a>(&'a self) -> FXWrLockGuardAsync<'a, B>
Provides write-lock to directly store the value. Never calls the lazy builder.