title: How go get address of slice as u64?
body: <p>I transfered this C struct:</p>
  <pre><code>  85 struct spi_ioc_transfer {
     86     __u64       tx_buf;
     87     __u64       rx_buf;
     88 
     89     __u32       len;
     90     __u32       speed_hz;
     91 
     92     __u16       delay_usecs;
     93     __u8        bits_per_word;
     94     __u8        cs_change;
     95     __u32       pad;
     96 
     97     /* If the contents of 'struct spi_ioc_transfer' ever change
     98      * incompatibly, then the ioctl number (currently 0) must change;
     99      * ioctls with constant size fields get a bit more in the way of
    100      * error checking than ones (like this) where that field varies.
    101      *
    102      * NOTE: struct layout is the same in 64bit and 32bit userspace.
    103      */
    104 };
  </code></pre>
  <p>to Rust:</p>
  <pre><code>struct SpiIocTransfer {
      tx_buf: u64,
      rx_buf: u64,
      len: u32,
      speed_hz: u32,
      delay_usecs: u16,
      bits_per_word: u8,
      cs_change: u8,
      pad: u32
      /* If the contents of 'struct spi_ioc_transfer' ever change
      * incompatibly, then the ioctl number (currently 0) must change;
      * ioctls with constant size fields get a bit more in the way of
      * error checking than ones (like this) where that field varies.
      *
      * NOTE: struct layout is the same in 64bit and 32bit userspace.
      */
  }
  </code></pre>
  <p>However, I'm having problems in filling <code>tx_buf</code> and <code>rx_buf</code>:</p>
  <p>C version:</p>
  <pre><code>int wiringPiSPIDataRW (int channel, unsigned char *data, int len)
  {
    struct spi_ioc_transfer spi ;
  
    channel &amp;= 1 ;
    memset (&amp;spi, 0, sizeof (spi)) ;
  
    spi.tx_buf        = (unsigned long)data ;
    spi.rx_buf        = (unsigned long)data ;
    spi.len           = len ;
  </code></pre>
  <p>My Rust version:</p>
  <pre><code>    pub fn spi_data_rw(&amp;mut self, channel_: i32, data: &amp;[u8], len: u32) -&gt; i32 {
          let channel = channel_ &amp; 1;
          let spi = SpiIocTransfer::new();
          spi.tx_buf        = data.as_mut_ptr();//(unsigned long) ?
          spi.rx_buf        = data.as_mut_ptr();//(unsigned long) ?
  </code></pre>
  <p>Error:</p>
  <pre><code>error[E0308]: mismatched types
    --&gt; src/w25q.rs:68:29
     |
  68 |         spi.rx_buf        = data.as_mut_ptr();//(unsigned long) ?
     |                             ^^^^^^^^^^^^^^^^^ expected `u64`, found *-ptr
     |
     = note:     expected type `u64`
             found raw pointer `*mut u8`
  </code></pre>
  <p>How do I get the address of the <code>data</code> slice as an <code>u64</code>?</p>