#[repr(transparent)]
pub struct Chain { actual_data: MaybeUninit<ChainInternal>, }
Expand description

The self-referencing struct.

Fields§

§actual_data: MaybeUninit<ChainInternal>

Implementations§

source§

impl Chain

source

pub(crate) fn new( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> &'this i32, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> &'this i32 ) -> Chain

Constructs a new instance of this self-referential struct. (See also ChainBuilder::build()). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> b: _
c_builderUse a function or closure: (b: &_) -> c: _
source

pub(crate) async fn new_async( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = &'this i32> + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = &'this i32> + 'this>> ) -> Chain

Constructs a new instance of this self-referential struct. (See also ChainAsyncBuilder::build()). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> b: _
c_builderUse a function or closure: (b: &_) -> c: _
source

pub(crate) async fn new_async_send( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = &'this i32> + Send + 'this>> ) -> Chain

Constructs a new instance of this self-referential struct. (See also ChainAsyncSendBuilder::build()). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> b: _
c_builderUse a function or closure: (b: &_) -> c: _
source

pub(crate) fn try_new<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Result<&'this i32, Error_>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Result<&'this i32, Error_> ) -> Result<Chain, Error_>

(See also ChainTryBuilder::try_build().) Like new, but builders for self-referencing fields can return results. If any of them fail, Err is returned. If all of them succeed, Ok is returned. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) fn try_new_or_recover<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Result<&'this i32, Error_>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Result<&'this i32, Error_> ) -> Result<Chain, (Error_, Heads)>

(See also ChainTryBuilder::try_build_or_recover().) Like try_new, but all head fields are returned in the case of an error. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) async fn try_new_async<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + 'this>> ) -> Result<Chain, Error_>

(See also ChainAsyncTryBuilder::try_build().) Like new, but builders for self-referencing fields can return results. If any of them fail, Err is returned. If all of them succeed, Ok is returned. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) async fn try_new_or_recover_async<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + 'this>> ) -> Result<Chain, (Error_, Heads)>

(See also ChainAsyncTryBuilder::try_build_or_recover().) Like try_new, but all head fields are returned in the case of an error. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) async fn try_new_async_send<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + Send + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + Send + 'this>> ) -> Result<Chain, Error_>

(See also ChainAsyncSendTryBuilder::try_build().) Like new, but builders for self-referencing fields can return results. If any of them fail, Err is returned. If all of them succeed, Ok is returned. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) async fn try_new_or_recover_async_send<Error_>( a: i32, b_builder: impl for<'this> FnOnce(&'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + Send + 'this>>, c_builder: impl for<'this> FnOnce(&'this &'this i32) -> Pin<Box<dyn Future<Output = Result<&'this i32, Error_>> + Send + 'this>> ) -> Result<Chain, (Error_, Heads)>

(See also ChainAsyncSendTryBuilder::try_build_or_recover().) Like try_new, but all head fields are returned in the case of an error. The arguments are as follows:

ArgumentSuggested Use
aDirectly pass in the value this field should contain
b_builderUse a function or closure: (a: &_) -> Result<b: _, Error_>
c_builderUse a function or closure: (b: &_) -> Result<c: _, Error_>
source

pub(crate) fn with_a<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow i32) -> ReturnType ) -> ReturnType

Provides limited immutable access to a. This method was generated because the contents of a are immutably borrowed by other fields.

source

pub(crate) fn borrow_a<'this>(&'this self) -> &'this i32

Provides limited immutable access to a. This method was generated because the contents of a are immutably borrowed by other fields.

source

pub(crate) fn with_b<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow &'this i32) -> ReturnType ) -> ReturnType

Provides limited immutable access to b. This method was generated because the contents of b are immutably borrowed by other fields.

source

pub(crate) fn borrow_b<'this>(&'this self) -> &'this &'this i32

Provides limited immutable access to b. This method was generated because the contents of b are immutably borrowed by other fields.

source

pub(crate) fn with_c<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow &'this i32) -> ReturnType ) -> ReturnType

Provides an immutable reference to c. This method was generated because c is a tail field.

source

pub(crate) fn borrow_c<'this>(&'this self) -> &'this &'this i32

Provides an immutable reference to c. This method was generated because c is a tail field.

source

pub(crate) fn with_c_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(&'outer_borrow mut &'this i32) -> ReturnType ) -> ReturnType

Provides a mutable reference to c. This method was generated because c is a tail field. No borrow_c_mut function was generated because Rust’s borrow checker is currently unable to guarantee that such a method would be used safely.

source

pub(crate) fn with<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this>) -> ReturnType ) -> ReturnType

This method provides immutable references to all tail and immutably borrowed fields.

source

pub(crate) fn with_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this0, 'this1, 'this2> FnOnce(BorrowedMutFields<'outer_borrow, 'this2, 'this1, 'this0>) -> ReturnType ) -> ReturnType

This method provides mutable references to all tail fields.

source

pub(crate) fn into_heads(self) -> Heads

This function drops all internally referencing fields and returns only the head fields of this struct.

Trait Implementations§

source§

impl Drop for Chain

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Chain

§

impl Send for Chain

§

impl Sync for Chain

§

impl Unpin for Chain

§

impl UnwindSafe for Chain

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.