[][src]Macro structural::z_unsafe_impl_get_field_raw_mut

macro_rules! z_unsafe_impl_get_field_raw_mut {
    (
        $Self:ident,
        field_tstr=$field_name:tt,
        name_generic=$name_param:ty,
    ) => { ... };
}

For semi-manual implementors of the GetFieldMut trait for structs.

This implements the [GetFieldMut::get_field_raw_mut] by returning a mutable pointer to a field, and [GetFieldMut::get_field_raw_mut_fn] by returning get_field_raw_mut as a function pointer.

Safety

This is an unsafe macro, because GetFieldMut requires no impl to borrow the same field mutably as any other, otherwise this would cause undefined behavior because it would create multiple mutable borrows to the same field.

Example

For an example where this macro is used, you can look at the manual implementation example of the GetFieldMut trait