pub struct VisibilityAsyncSendBuilder<PublicFieldBuilder_: for<'this> FnOnce(&'this Box<i32>) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>>, PubCrateFieldBuilder_: for<'this> FnOnce(&'this Box<i32>) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>>> {
    pub private_field: Box<i32>,
    pub public_field_builder: PublicFieldBuilder_,
    pub pub_crate_field_builder: PubCrateFieldBuilder_,
}
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
private_fieldDirectly pass in the value this field should contain
public_field_builderUse a function or closure: (private_field: &_) -> public_field: _
pub_crate_field_builderUse a function or closure: (private_field: &_) -> pub_crate_field: _

Fields§

§private_field: Box<i32>§public_field_builder: PublicFieldBuilder_§pub_crate_field_builder: PubCrateFieldBuilder_

Implementations§

source§

impl<PublicFieldBuilder_: for<'this> FnOnce(&'this Box<i32>) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>>, PubCrateFieldBuilder_: for<'this> FnOnce(&'this Box<i32>) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>>> VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>

source

pub async fn build(self) -> Visibility

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

Auto Trait Implementations§

§

impl<PublicFieldBuilder_, PubCrateFieldBuilder_> RefUnwindSafe for VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>
where PubCrateFieldBuilder_: RefUnwindSafe, PublicFieldBuilder_: RefUnwindSafe,

§

impl<PublicFieldBuilder_, PubCrateFieldBuilder_> Send for VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>
where PubCrateFieldBuilder_: Send, PublicFieldBuilder_: Send,

§

impl<PublicFieldBuilder_, PubCrateFieldBuilder_> Sync for VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>
where PubCrateFieldBuilder_: Sync, PublicFieldBuilder_: Sync,

§

impl<PublicFieldBuilder_, PubCrateFieldBuilder_> Unpin for VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>
where PubCrateFieldBuilder_: Unpin, PublicFieldBuilder_: Unpin,

§

impl<PublicFieldBuilder_, PubCrateFieldBuilder_> UnwindSafe for VisibilityAsyncSendBuilder<PublicFieldBuilder_, PubCrateFieldBuilder_>
where PubCrateFieldBuilder_: UnwindSafe, PublicFieldBuilder_: 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.