pub struct OxMut<'a> {
pub shape: &'static Shape,
/* private fields */
}Expand description
Safe mutable reference with shape.
Unlike OxPtrMut, this has a lifetime parameter for borrow checking.
Fields§
§shape: &'static ShapeThe shape describing the type.
Implementations§
Source§impl<'a> OxMut<'a>
impl<'a> OxMut<'a>
Sourcepub fn from_mut<T: Facet<'a> + ?Sized>(t: &'a mut T) -> Self
pub fn from_mut<T: Facet<'a> + ?Sized>(t: &'a mut T) -> Self
Create an OxMut from an actual Rust mutable reference.
This is the safe constructor - the lifetime 'a is captured from the reference,
guaranteeing exclusive access for 'a.
Sourcepub const unsafe fn new(ptr: PtrMut, shape: &'static Shape) -> Self
pub const unsafe fn new(ptr: PtrMut, shape: &'static Shape) -> Self
Create an OxMut from a raw pointer and shape.
§Safety
The caller must guarantee that:
- The pointer is valid and points to initialized data matching
shape - The caller has exclusive (mutable) access to the data for lifetime
'a - The shape correctly describes the pointed-to type
Violating these invariants will cause undefined behavior when using
safe methods like PartialEq::eq, core::fmt::Debug::fmt, etc.
Sourcepub const fn as_ptr_mut(&self) -> OxPtrMut
pub const fn as_ptr_mut(&self) -> OxPtrMut
Convert to an unlifetimed OxPtrMut.
Trait Implementations§
Source§impl PartialOrd for OxMut<'_>
impl PartialOrd for OxMut<'_>
impl<'a> Copy for OxMut<'a>
Auto Trait Implementations§
impl<'a> Freeze for OxMut<'a>
impl<'a> RefUnwindSafe for OxMut<'a>
impl<'a> !Send for OxMut<'a>
impl<'a> !Sync for OxMut<'a>
impl<'a> Unpin for OxMut<'a>
impl<'a> !UnwindSafe for OxMut<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more