pub trait UnsafeDerefMut: Deref {
    unsafe fn deref_mut(&mut self) -> &mut Self::Target;
}
Expand description

This is a convenient trait we dont’t find in the rust std library. Accessing member of a ffi struct mutably is not always safe(consider directly changing the capacity of a Vec). But for some members, accessing them is a need. So UnsafeDerefMut is come to rescue. You can use foo.deref_mut().member = bar in a unsafe block if type of foo implements this trait.

Required methods

Mutably dereferences the value, unsafely.

Safety

This function should be used carefully, adding safe convenient for rsmpeg is preferred.

Implementors