fn unchecked_cast<Q>(mut self) -> Chan<Q, Tx, Rx>
    where
        Q: Session,
    {
        // Cast a pointer to `self` to the new desired (phantom) session type
        let new: *mut Chan<Q, _, _> = (&mut self as *mut Chan<_, _, _>).cast();
        // Forget `self` to prevent a double-free error
        mem::forget(self);
        // Read the contents of `new` to get the new channel
        unsafe { new.read() }
    }
/// Cast a channel to arbitrary new session types and environment. Use with care!
Cast a channel to arbitrary new session types and environment. Use with care!
Cast a channel to arbitrary new session types and environment . Use with care!
fn unchecked_cast<Q>(mut self) -> Chan<Q, Tx, Rx>
    where
        Q: Session,
    {
        // Cast a pointer to `self` to the new desired (phantom) session type
        let new: *mut Chan<Q, _, _> = (&mut self as *mut Chan<_, _, _>).cast();
        // Forget `self` to prevent a double-free error
        mem::forget(self);
        // Read the contents of `new` to get the new channel
        unsafe { new.read() }
    }
fn unchecked_cast < Q > ( mut self ) -> Chan < Q , Tx , Rx > where Q : Session , { // Cast a pointer to `self` to the new desired (phantom) session type let new : * mut Chan < Q , _ , _ > = ( & mut self as * mut Chan < _ , _ , _ > ) . cast ( ) ; // Forget `self` to prevent a double-free error mem :: forget ( self ) ; // Read the contents of `new` to get the new channel unsafe { new . read ( ) } }
Cast a channel to arbitrary new session types and environment.
Cast a channel to arbitrary new session types and environment .
mut self