#[repr(transparent)]pub struct Wrapped<T>(*const RefCell<T>);
Expand description
Wraps structures to pass them safely to/from C Since C doesn’t respect borrowing rules, RefCell will enforce them dynamically (only 1 writer/many readers) Rc is implied and will ensure timely dropping
Tuple Fields§
§0: *const RefCell<T>
Implementations§
Trait Implementations§
Source§impl<T: Clone> CloneOwned for Wrapped<T>
ToOwned won’t work here
because it’s really difficult to implement Borrow on Wrapped
with the Rc<RefCell<>> chain on the way to the data
impl<T: Clone> CloneOwned for Wrapped<T>
ToOwned won’t work here
because it’s really difficult to implement Borrow on Wrapped
impl<T> COpaquePtr for Wrapped<T>
Auto Trait Implementations§
impl<T> Freeze for Wrapped<T>
impl<T> !RefUnwindSafe for Wrapped<T>
impl<T> !Send for Wrapped<T>
impl<T> !Sync for Wrapped<T>
impl<T> Unpin for Wrapped<T>
impl<T> !UnwindSafe for Wrapped<T>
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