bevy_reflect

Function map_try_apply

Source
pub fn map_try_apply<M: Map>(
    a: &mut M,
    b: &dyn Reflect,
) -> Result<(), ApplyError>
Expand description

Tries to apply the elements of reflected map b to the corresponding elements of map a and returns a Result.

If a key from b does not exist in a, the value is cloned and inserted.

ยงErrors

This function returns an ApplyError::MismatchedKinds if b is not a reflected map or if applying elements to each other fails.