pub struct WithConstParamAsyncBuilder<T: 'static, const REV: bool, DrefBuilder_: for<'this> FnOnce(&'this RefCell<T>) -> Pin<Box<dyn Future<Output = Option<Box<Ext<'this, T, REV>>>> + 'this>>> {
    pub data: RefCell<T>,
    pub dref_builder: DrefBuilder_,
}
Expand description

A more verbose but stable way to construct self-referencing structs. It is comparable to using StructName { field1: value1, field2: value2 } rather than StructName::new(value1, value2). This has the dual benefit of making your code both easier to refactor and more readable. Call build() to construct the actual struct. The fields of this struct should be used as follows:

FieldSuggested Use
dataDirectly pass in the value this field should contain
dref_builderUse a function or closure: (data: &_) -> dref: _

Fields§

§data: RefCell<T>§dref_builder: DrefBuilder_

Implementations§

source§

impl<T: 'static, const REV: bool, DrefBuilder_: for<'this> FnOnce(&'this RefCell<T>) -> Pin<Box<dyn Future<Output = Option<Box<Ext<'this, T, REV>>>> + 'this>>> WithConstParamAsyncBuilder<T, REV, DrefBuilder_>

source

pub async fn build(self) -> WithConstParam<T, REV>

Calls WithConstParam::new() using the provided values. This is preferable over calling new() directly for the reasons listed above.

Auto Trait Implementations§

§

impl<T, const REV: bool, DrefBuilder_> !RefUnwindSafe for WithConstParamAsyncBuilder<T, REV, DrefBuilder_>

§

impl<T, const REV: bool, DrefBuilder_> Send for WithConstParamAsyncBuilder<T, REV, DrefBuilder_>
where DrefBuilder_: Send, T: Send,

§

impl<T, const REV: bool, DrefBuilder_> !Sync for WithConstParamAsyncBuilder<T, REV, DrefBuilder_>

§

impl<T, const REV: bool, DrefBuilder_> Unpin for WithConstParamAsyncBuilder<T, REV, DrefBuilder_>
where DrefBuilder_: Unpin, T: Unpin,

§

impl<T, const REV: bool, DrefBuilder_> UnwindSafe for WithConstParamAsyncBuilder<T, REV, DrefBuilder_>
where DrefBuilder_: UnwindSafe, T: 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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.