Struct FXProxySync

Source
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,

Source

pub fn into_inner(self) -> Option<B::Value>

Consumes the container, returns the wrapped value or None if the container is empty

Source

pub fn is_set(&self) -> bool

Returns true if the container has a value.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn write<'a>(&'a self) -> FXWrLockGuardSync<'a, B>

Provides write-lock to directly store the value. Never calls the lazy builder.

Source

pub fn clear(&self) -> Option<B::Value>

Resets the container into uninitialized state

Trait Implementations§

Source§

impl<B, V> Clone for FXProxySync<B>
where B: FXBuilderWrapperSync<Value = V> + Clone, V: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B, V> Debug for FXProxySync<B>
where B: FXBuilderWrapperSync<Value = V>, V: Debug,

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B, V> PartialEq for FXProxySync<B>
where B: FXBuilderWrapperSync<Value = V>, V: PartialEq,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<B, V> Eq for FXProxySync<B>
where B: FXBuilderWrapperSync<Value = V>, V: Eq,

Auto Trait Implementations§

§

impl<B> !Freeze for FXProxySync<B>

§

impl<B> !RefUnwindSafe for FXProxySync<B>

§

impl<B> Send for FXProxySync<B>
where <B as FXBuilderWrapper>::Value: Send, B: Send,

§

impl<B> Sync for FXProxySync<B>
where <B as FXBuilderWrapper>::Value: Send + Sync, B: Send + Sync,

§

impl<B> Unpin for FXProxySync<B>
where <B as FXBuilderWrapper>::Value: Unpin, B: Unpin,

§

impl<B> UnwindSafe for FXProxySync<B>
where <B as FXBuilderWrapper>::Value: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, U> FXInto<U> for T
where U: FXFrom<T>,

Source§

fn fx_into(self) -> U

Source§

impl<T, U> FXTryInto<U> for T
where U: FXTryFrom<T>,

Source§

type Error = <U as FXTryFrom<T>>::Error

Source§

fn fx_try_into(self) -> Result<U, <T as FXTryInto<U>>::Error>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.