Lines Matching full:wrapper

367 /// struct Wrapper<T>(T);
371 /// /// `Wrapper<T>` is `repr(transparent)`, so it is sound to implement any
373 /// impl_or_verify!(T: FromZeros => FromZeros for Wrapper<T>);
374 /// impl_or_verify!(T: FromBytes => FromBytes for Wrapper<T>);
375 /// impl_or_verify!(T: IntoBytes => IntoBytes for Wrapper<T>);
376 /// impl_or_verify!(T: Unaligned => Unaligned for Wrapper<T>);
733 /// Implements `TransmuteFrom` and `SizeEq` for `T` and `$wrapper<T>`.
737 /// `T` and `$wrapper<T>` must have the same bit validity, and must have the
739 /// `T`-to-`$wrapper<T>` cast and a `$wrapper<T>`-to-`T` cast must be
742 ($vis:vis T $(: ?$optbound:ident)? => $wrapper:ident<T>) => {{
748 // SAFETY: The caller promises that `T` and `$wrapper<T>` have the same
750 unsafe impl<T $(: ?$optbound)?> TransmuteFrom<T, Valid, Valid> for $wrapper<T> {}
752 unsafe impl<T $(: ?$optbound)?> TransmuteFrom<$wrapper<T>, Valid, Valid> for T {}
753 // SAFETY: The caller promises that a `T` to `$wrapper<T>` cast is
755 define_cast!(unsafe { $vis CastToWrapper<T $(: ?$optbound)? > = T => $wrapper<T> });
756 // SAFETY: The caller promises that a `T` to `$wrapper<T>` cast is
758 unsafe impl<T $(: ?$optbound)?> CastExact<T, $wrapper<T>> for CastToWrapper {}
759 // SAFETY: The caller promises that a `$wrapper<T>` to `T` cast is
761 define_cast!(unsafe { $vis CastFromWrapper<T $(: ?$optbound)? > = $wrapper<T> => T });
762 // SAFETY: The caller promises that a `$wrapper<T>` to `T` cast is
764 unsafe impl<T $(: ?$optbound)?> CastExact<$wrapper<T>, T> for CastFromWrapper {}
766 impl<T $(: ?$optbound)?> SizeEq<T> for $wrapper<T> {
769 impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for T {
773 impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for $wrapper<T> {
780 impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for ReadOnly<T> {
788 impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for ReadOnly<$wrapper<T>> {
790 $wrapper<T>,
791 <$wrapper<T> as SizeEq<ReadOnly<T>>>::CastFrom,
792 <ReadOnly<$wrapper<T>> as SizeEq<$wrapper<T>>>::CastFrom,
795 impl<T $(: ?$optbound)?> SizeEq<ReadOnly<$wrapper<T>>> for ReadOnly<T> {
797 $wrapper<T>,
798 <$wrapper<T> as SizeEq<ReadOnly<$wrapper<T>>>>::CastFrom,
799 <ReadOnly<T> as SizeEq<$wrapper<T>>>::CastFrom,