pub struct FXProxySync<B>where
B: FXBuilderWrapperSync,{ /* private fields */ }
Expand description
Container type for lazy fields
Implementations§
Source§impl<B> FXProxySync<B>where
B: FXBuilderWrapperSync,
impl<B> FXProxySync<B>where
B: FXBuilderWrapperSync,
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 fn lazy_init(&self, owner: &B::Owner)
pub 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 fn read<'a>(
&'a self,
owner: &B::Owner,
) -> MappedRwLockReadGuard<'a, B::Value>
pub fn read<'a>( &'a self, owner: &B::Owner, ) -> MappedRwLockReadGuard<'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 fn read_mut<'a>(
&'a self,
owner: &B::Owner,
) -> MappedRwLockWriteGuard<'a, B::Value>
pub fn read_mut<'a>( &'a self, owner: &B::Owner, ) -> MappedRwLockWriteGuard<'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 fn try_read<'a>(
&'a self,
owner: &B::Owner,
) -> Result<MappedRwLockReadGuard<'a, B::Value>, B::Error>
pub fn try_read<'a>( &'a self, owner: &B::Owner, ) -> Result<MappedRwLockReadGuard<'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 fn try_read_mut<'a>(
&'a self,
owner: &B::Owner,
) -> Result<MappedRwLockWriteGuard<'a, B::Value>, B::Error>
pub fn try_read_mut<'a>( &'a self, owner: &B::Owner, ) -> Result<MappedRwLockWriteGuard<'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 fn write<'a>(&'a self) -> FXWrLockGuardSync<'a, B>
pub fn write<'a>(&'a self) -> FXWrLockGuardSync<'a, B>
Provides write-lock to directly store the value. Never calls the lazy builder.