bevy::reflect

Function set_try_apply

source
pub fn set_try_apply<S>(
    a: &mut S,
    b: &(dyn PartialReflect + 'static),
) -> Result<(), ApplyError>
where S: Set,
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.