Enum mt_dom::AttValue[][src]

pub enum AttValue<VAL, EVENT, MSG> {
    Plain(VAL),
    Callback(Callback<EVENT, MSG>),
}
Expand description

Attribute Value which can be a plain attribute or a callback

Variants

Plain(VAL)

Plain value

Callback(Callback<EVENT, MSG>)

An event listener attribute

Implementations

return a reference to the plain value if it is a plain value

transform att_value such that MSG becomes MSG2

return a reference to the callback if it is a callback

return true if this is a callback

Trait Implementations

Note: using the #[derive(Clone)] needs EVENT and MSG to also be Clone

The reason this is manually implemented is, so that EVENT and MSG doesn’t need to be Clone as it is part of the Callback objects and cloning it is just cloning the pointer of the actual callback function

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Note: using the #[derive(Debug)] needs EVENT and MSG to also be Debug

The reason this is manually implemented is, so that EVENT and MSG doesn’t need to be Debug as it is part of the Callback objects and are not shown.

Formats the value using the given formatter. Read more

Performs the conversion.

Note: using the #[derive(PartialEq)] needs EVENT and MSG to also be PartialEq.

The reason this is manually implemented is, so that EVENT and MSG doesn’t need to be PartialEq as it is part of the Callback objects and are not compared

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

Performs the conversion.

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)

recently added

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.