pub struct FXProxy<B>where
B: FXBuilderWrapperAsync,{ /* private fields */ }Expand description
Container type for lazy fields
Implementations§
Source§impl<B, E> FXProxy<B>where
B: FXBuilderWrapperAsync<Error = E>,
E: Debug,
impl<B, E> FXProxy<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(&self, owner: &B::Owner)
pub async fn lazy_init(&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,
) -> FXProxyReadGuard<'a, B::Value>
pub async fn read<'a>( &'a self, owner: &B::Owner, ) -> FXProxyReadGuard<'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,
) -> FXProxyWriteGuard<'a, B::Value>
pub async fn read_mut<'a>( &'a self, owner: &B::Owner, ) -> FXProxyWriteGuard<'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<FXProxyReadGuard<'a, B::Value>, B::Error>
pub async fn try_read<'a>( &'a self, owner: &B::Owner, ) -> Result<FXProxyReadGuard<'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<FXProxyWriteGuard<'a, B::Value>, B::Error>
pub async fn try_read_mut<'a>( &'a self, owner: &B::Owner, ) -> Result<FXProxyWriteGuard<'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.