fn cast_mut<T: ByteSafe>(&mut self) -> &mut [T]
    {
        <T>::bytesafe();
        <Self>::bytesafe();

        /* Verify alignment is fine */
        let src_ptr = self as *const _ as *const u8 as usize;
        assert!(core::mem::align_of::<T>() > 0 && 
                (src_ptr % core::mem::align_of::<T>()) == 0,
                "cast_mut alignment mismatch");

        /* Validate that self is evenly divisible by T */
        let dest_sz = core::mem::size_of::<T>();
        let src_sz  = core::mem::size_of_val(self);
        assert!(dest_sz > 0 && (src_sz % dest_sz) == 0,
            "cast_mut src cannot be evenly divided by T");

        /* Convert self into a slice of T's */
        unsafe {
            core::slice::from_raw_parts_mut(self as *mut _ as *mut T,
                                           src_sz / dest_sz)
        }
    }
/// Cast `Self` into a slice of `T` spanning the size of `Self` mutably
///
/// This function will directly cast the reference of `Self` into a slice
/// of `T`, given `Self` is evenly divisible by `T` and alignment matches.
///
/// The resulting slice will map all bytes of `Self`, never will a partial
/// cast occur.


The resulting slice will map all bytes of `Self`, never will a partial
cast occur.
The resulting slice will map all bytes of ` Self ` never will a partial cast occur .
fn cast_mut<T: ByteSafe>(&mut self) -> &mut [T]
    {
        <T>::bytesafe();
        <Self>::bytesafe();
        /* Verify alignment is fine */
        let src_ptr = self as *const _ as *const u8 as usize;
        assert!(core::mem::align_of::<T>() > 0 && 
                (src_ptr % core::mem::align_of::<T>()) == 0,
                "cast_mut alignment mismatch");
        /* Validate that self is evenly divisible by T */
        let dest_sz = core::mem::size_of::<T>();
        let src_sz  = core::mem::size_of_val(self);
        assert!(dest_sz > 0 && (src_sz % dest_sz) == 0,
            "cast_mut src cannot be evenly divided by T");
        /* Convert self into a slice of T's */
        unsafe {
            core::slice::from_raw_parts_mut(self as *mut _ as *mut T,
                                           src_sz / dest_sz)
        }
    }
fn cast_mut < T : ByteSafe > ( & mut self ) -> & mut [ T ] { < T > :: bytesafe ( ) ; < Self > :: bytesafe ( ) ; /* Verify alignment is fine */ let src_ptr = self as * const _ as * const u8 as usize ; assert ! ( core mem align_of T ( ) 0 ( src_ptr core mem align_of T ( ) ) 0 " " ) ; /* Validate that self is evenly divisible by T */ let dest_sz = core :: mem :: size_of :: < T > ( ) ; let src_sz = core :: mem :: size_of_val ( self ) ; assert ! ( dest_sz 0 ( src_sz dest_sz ) 0 " " ) ; /* Convert self into a slice of T's */ unsafe { core :: slice :: from_raw_parts_mut ( self as * mut _ as * mut T , src_sz / dest_sz ) } }
Cast `Self` into a slice of `T` spanning the size of `Self` mutably
This function will directly cast the reference of `Self` into a slice
of `T`, given `Self` is evenly divisible by `T` and alignment matches.
Cast ` Self ` into a slice of ` T ` spanning the size of ` Self ` mutably This function will directly cast the reference of ` Self ` into a slice of ` T ` given ` Self ` is evenly divisible by ` T ` and alignment matches .
&mut self
&mut self