Home
last modified time | relevance | path

Searched refs:ReadOnly (Results 1 – 8 of 8) sorted by relevance

/linux/rust/zerocopy/src/
H A Dwrappers.rs618 pub struct ReadOnly<T: ?Sized> { struct
624 impl<T> ReadOnly<T> { implementation
628 pub const fn new(t: T) -> ReadOnly<T> { in new()
629 ReadOnly { inner: t } in new()
635 pub fn into_inner(r: ReadOnly<T>) -> T { in into_inner()
640 impl<T: ?Sized> ReadOnly<T> { implementation
642 pub(crate) fn as_mut(r: &mut ReadOnly<T>) -> &mut T { in as_mut()
652 pub(crate) const unsafe fn as_ref_unchecked(r: &ReadOnly<T>) -> &T { in as_ref_unchecked()
661 unsafe_impl_known_layout!(T: ?Sized + KnownLayout => #[repr(T)] ReadOnly<T>);
673 unsafe_impl!(T: ?Sized + Unaligned => Unaligned for ReadOnly<T>);
[all …]
H A Dimpls.rs434 impl<$($tyvar)?> SizeEq<ReadOnly<$atomic>> for ReadOnly<$prim> {
895 let c: Ptr<'_, [ReadOnly<T>; N], _> = c.cast::<_, crate::pointer::cast::CastSized, _>();
896 let c: Ptr<'_, [ReadOnly<T>], _> = c.as_slice();
897 let c: Ptr<'_, ReadOnly<[T]>, _> = c.cast::<_, crate::pointer::cast::CastUnsized, _>();
912 let c: Ptr<'_, [ReadOnly<T>], _> = c.cast::<_, crate::pointer::cast::CastUnsized, _>();
1401 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(f: F); in test_impls()
1406 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(f: F) { in test_impls()
1408 f(ReadOnly::<Self>::new_box_zeroed().unwrap()); in test_impls()
1411 let mut t = ReadOnly::new(Self::new_zeroed()); in test_impls()
1412 let ptr: *mut T = ReadOnly::as_mut(&mut t); in test_impls()
[all …]
/linux/rust/zerocopy/src/util/
H A Dmacros.rs746 use crate::wrappers::ReadOnly;
773 impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for $wrapper<T> {
776 <T as SizeEq<ReadOnly<T>>>::CastFrom,
780 impl<T $(: ?$optbound)?> SizeEq<$wrapper<T>> for ReadOnly<T> {
784 <ReadOnly<T> as SizeEq<T>>::CastFrom,
788 impl<T $(: ?$optbound)?> SizeEq<ReadOnly<T>> for ReadOnly<$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> {
798 <$wrapper<T> as SizeEq<ReadOnly<$wrapper<T>>>>::CastFrom,
[all …]
H A Dmacro_util.rs35 FromBytes, Immutable, IntoBytes, KnownLayout, Ptr, ReadOnly, TryFromBytes, ValidityError,
534 let mu_dst: mem::MaybeUninit<ReadOnly<Dst>> = in try_transmute()
549 Ok(ReadOnly::into_inner(unsafe { mu_dst.assume_init() })) in try_transmute()
/linux/arch/mips/include/asm/fw/arc/
H A Dhinv.h88 ReadOnly = 2, enumerator
/linux/rust/zerocopy/src/pointer/
H A Dmod.rs25 use crate::wrappers::ReadOnly;
32 Ptr<'a, ReadOnly<T>, (invariant::Shared, Alignment, invariant::Initialized)>;
H A Dptr.rs625 ReadOnly,
775 ReadOnly<T>: Read<I::Aliasing, R>, in try_into_valid()
/linux/rust/zerocopy-derive/derive/
H A Dtry_from_bytes.rs332 #zerocopy_crate::ReadOnly<#variant_struct_ident #ty_generics>, in derive_is_bit_valid()
428 #zerocopy_crate::ReadOnly<___ZerocopyRawEnum #ty_generics>, in derive_is_bit_valid()