pub struct IndefiniteEventBuilder { /* private fields */ }
Expand description

Constructs an IndefiniteEvent.

If the type used for a call to IndefiniteEventBuilder.details has a non-default implementation of IntoEvent::operation, it will override the current operation and cause any call to IndefiniteEventBuilder.operation to panic.

Examples

Create an event with no details

Any IntoEvent type can be substituted into the details call.

⚠️ Note the above statement if that type uses the non-default implementation of IntoEvent::operation. ⚠️

let event = IndefiniteEventBuilder::new()
    .caller(Principal::anonymous())
    .status(EventStatus::Completed)
    .operation("Foo")
    .details(vec![])
    .build()?;

Implementations

Sets the caller of the event.

Sets the operation of the event.

Panics

Panics if the operation is already set from an IntoEvent type which sets the operation.

Sets the details of the event.

You can combine multiple IntoEvent types into one IndefiniteEvent with this method as long as only one of them has a non-default implementation of IntoEvent::operation.

Panics

Panics if operation has already been set by an IntoEvent::operation call.

Builds an IndefiniteEvent from the builder.

Panics

Panics if caller, operation, or details has not already been set.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

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.