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.
Trait Implementations§
Auto Trait Implementations§
impl<B> !Freeze for FXProxy<B>
impl<B> !RefUnwindSafe for FXProxy<B>
impl<B> Send for FXProxy<B>
impl<B> Sync for FXProxy<B>
impl<B> Unpin for FXProxy<B>
impl<B> UnwindSafe for FXProxy<B>where
<B as FXBuilderWrapper>::Value: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)