Lines Matching defs:cast
169 use crate::pointer::cast::{CastExact, CastSized, IdCast};
244 raw.as_ptr().cast(),
394 raw.as_ptr().cast(),
500 /// Callers should prefer [`cast`] or [`project`] where possible.
502 /// [`cast`]: Ptr::cast
527 P: crate::pointer::cast::Project<T, U>,
637 pointer::{cast::IdCast, transmute::TryTransmuteFromPtr},
841 pointer::cast::{AsBytesCast, Cast},
853 /// Callers should prefer [`cast`][Ptr::cast] where possible.
888 pub fn cast<U, C, R>(self) -> Ptr<'a, U, (I::Aliasing, Unaligned, I::Validity)>
913 use crate::pointer::cast::Projection;
1112 /// Attempts to cast `self` to a `U` using the given cast type.
1115 /// then the cast will only succeed if it would produce an object with
1131 /// - If this is a prefix cast, `ptr` has the same address as `self`.
1132 /// - If this is a suffix cast, `remainder` has the same address as
1195 /// Attempts to cast `self` into a `U`, failing if all of the bytes of
1256 // `*const UnsafeCell<T> as *const T` is a size-preserving cast.
1451 unsafe { core::slice::from_raw_parts(t.cast::<u8>(), len) }
1604 // metadata to overflow to 0, and thus the cast would spuriously