We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TryFrom<Pin<$Rc<T>>> for Pin<$RcBox<T>>
1 parent a1bc159 commit afcaba9Copy full SHA for afcaba9
crates/rc-box/src/lib.rs
@@ -84,6 +84,19 @@ macro_rules! rc_box {
84
}
85
86
87
+ impl<T: ?Sized> TryFrom<Pin<$Rc<T>>> for Pin<$RcBox<T>> {
88
+ type Error = Pin<$Rc<T>>;
89
+ fn try_from(v: Pin<$Rc<T>>) -> Result<Pin<$RcBox<T>>, Pin<$Rc<T>>> {
90
+ unsafe {
91
+ let v = Pin::into_inner_unchecked(v);
92
+ match $RcBox::<T>::try_from(v) {
93
+ Ok(this) => Ok(Pin::new_unchecked(this)),
94
+ Err(v) => Err(Pin::new_unchecked(v)),
95
+ }
96
97
98
99
+
100
impl<T: ?Sized> $RcBox<T> {
101
unsafe fn from_unchecked<V>(v: V) -> Self
102
where
0 commit comments