use core::cell::RefMut; use core::fmt; use core::ops::Deref; use core::pin::Pin;
#[derive(Debug)] /// A wrapper type for a mutably borrowed value from a `PinCell<T>`. pubstruct PinMut<'a, T: ?Sized> { pub(crate) inner: Pin<RefMut<'a, T>>,
}
impl<'a, T: ?Sized> Deref for PinMut<'a, T> { type Target = T;
fn deref(&self) -> &T {
&*self.inner
}
}
impl<'a, T: ?Sized> PinMut<'a, T> { /// Get a pinned mutable reference to the value inside this wrapper. pubfn as_mut<'b>(orig: &'b mut PinMut<'a, T>) -> Pin<&'b mut T> {
orig.inner.as_mut()
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.