bevy_reflect

Function set_try_apply

Source
pub fn set_try_apply<S: Set>(
    a: &mut S,
    b: &dyn PartialReflect,
) -> Result<(), ApplyError>
Expand description

Tries to apply the elements of reflected set b to the corresponding elements of set 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 set or if applying elements to each other fails.