use core::cell::Ref; use core::fmt; use core::ops::Deref; use core::pin::Pin;
#[derive(Debug)] /// A wrapper type for a immutably borrowed value from a `PinCell<T>`. pubstruct PinRef<'a, T: ?Sized> { pub(crate) inner: Pin<Ref<'a, T>>,
}
impl<'a, T: ?Sized> Deref for PinRef<'a, T> { type Target = T;
fn deref(&self) -> &T {
&*self.inner
}
}
impl<'a, T: ?Sized> PinRef<'a, T> { /// Get a pinned reference to the value inside this wrapper. pubfn as_ref<'b>(orig: &'b PinRef<'a, T>) -> Pin<&'b T> {
orig.inner.as_ref()
}
}
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.