Struct Parent
pub struct Parent<T> { /* private fields */ }
Storage wrapper for the auto-injected parent field on a struct that
declares #[wasm_bindgen(extends = Parent)].
Under the hood this is an Rc<WasmRefCell<T>> so that wasm-bindgen can
produce a separately-refcounted parent pointer for JS-side prototype
dispatch. Use Parent::borrow / Parent::borrow_mut to access the
inner value. You should not need to construct Parent<T> directly
outside the child's constructor; the [From<T>] impl is the typical way
to initialize the injected parent field.
Clone is a cheap Rc clone — both copies point at the same parent
data. Debug prints the wrapper plus the inner T (when T: Debug).
Implementations
impl<T> Parent<T>
fn new(value: T) -> SelfWraps a value in a new
Parent<T>.fn borrow(&self) -> Ref<'_, T>Immutably borrows the wrapped value.
Panics (or throws on the wasm target) if the value is currently mutably borrowed.
fn borrow_mut(&self) -> RefMut<'_, T>Mutably borrows the wrapped value.
Panics (or throws on the wasm target) if the value is currently borrowed.
Trait Implementations
impl<T> Clone for Parent<T>
fn clone(&self) -> Self
impl<T> From<T> for Parent<T>
fn from(value: T) -> Self
impl<T: Debug> Debug for Parent<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result