impl<T: ?Sized, A: Allocator> Deref for Rc<T, A> {
type Target = T;
#[inline(always)]
fn deref(&self) -> &T {
&self.inner().value
}
}
并且inner是一个非公共函数,因此它不在文档中,但搜索相同的源文件会产生以下结果:
impl<T: ?Sized, A: Allocator> Rc<T, A> {
#[inline(always)]
fn inner(&self) -> &RcBox<T> {
// This unsafety is ok because while this Rc is alive we're guaranteed
// that the inner pointer is valid.
unsafe { self.ptr.as_ref() }
}
}
当您需要查找实现时,您始终可以使用
source
文档中的链接。在这种特定情况下,它将是 上的链接impl Deref for Rc
,导致以下代码:并且
inner
是一个非公共函数,因此它不在文档中,但搜索相同的源文件会产生以下结果: