MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / cast

Method cast

src/fast.rs:274–284  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

272 /// Casts `&mut FastSlice<T>` to `&mut FastSlice<B>`.
273 #[inline(always)]
274 pub fn cast<B>(&mut self) -> &mut FastSlice<'a, B>
275 where
276 T: bytemuck::Pod,
277 B: bytemuck::Pod,
278 {
279 use std::mem::*;
280 assert_eq!(size_of::<T>(), size_of::<B>());
281 assert_eq!(align_of::<T>(), align_of::<B>());
282 // Safety: size/align are equal and both are bytemuck::Pod.
283 unsafe { transmute(self) }
284 }
285}
286
287pub trait NextUnchecked<'a, T: Copy> {

Callers 1

as_primitiveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected