Struct ouroboros_examples::DataAndRef[][src]

pub struct DataAndRef { /* fields omitted */ }

Implementations

Constructs a new instance of this self-referential struct. (See also DataAndRefBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> data_ref: _

Constructs a new instance of this self-referential struct. (See also DataAndRefAsyncBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> data_ref: _

(See also DataAndRefTryBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> Result<data_ref: _, Error_>

(See also DataAndRefTryBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> Result<data_ref: _, Error_>

(See also DataAndRefAsyncTryBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> Result<data_ref: _, Error_>

(See also DataAndRefAsyncTryBuilder::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
dataDirectly pass in the value this field should contain
data_ref_builderUse a function or closure: (data: &_) -> Result<data_ref: _, Error_>

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

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

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

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

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

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

This method provides mutable references to all tail fields.

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.