diff --git a/src/storage.rs b/src/storage.rs index 6d19aed511..b4e9269cef 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -13,7 +13,15 @@ pub(crate) trait SealedStorage { /// - [`OwnedStorage`]: stores the data in an array `[T; N]` whose size is known at compile time. /// - [`ViewStorage`]: stores the data in an unsized `[T]`. /// -/// This allows containers to be generic over either sized or unsized storage. +/// This allows containers to be generic over either sized or unsized storage. For example, +/// the [`vec`](crate::vec) module contains a [`VecInner`](crate::vec::VecInner) struct +/// that's generic on [`Storage`], and two type aliases for convenience: +/// +/// - [`Vec`](crate::vec::Vec) = `VecInner>` +/// - [`VecView`](crate::vec::VecView) = `VecInner` +/// +/// `Vec` can be unsized into `VecView`, either by unsizing coercions such as `&mut Vec -> &mut VecView` or +/// `Box -> Box`, or explicitly with [`.as_view()`](crate::vec::Vec::as_view) or [`.as_mut_view()`](crate::vec::Vec::as_mut_view). /// /// This trait is sealed, so you cannot implement it for your own types. You can only use /// the implementations provided by this crate.