pub fn to_str(self, buf: &mut [u8; 36]) -> &mut str {
        let bytes = self.to_bytes();
        let time_low = u32::from_be_bytes(bytes[..4].try_into().unwrap());
        let time_mid = u16::from_be_bytes(bytes[4..6].try_into().unwrap());
        let time_hi_and_version = u16::from_be_bytes(bytes[6..8].try_into().unwrap());
        let clock_seq_hi_and_reserved = u8::from_be_bytes(bytes[8..9].try_into().unwrap());
        let clock_seq_low = u8::from_be_bytes(bytes[9..10].try_into().unwrap());
        let mut node = [0; 8];
        // Leading zeros, and last 48 bits/6 bytes
        node[2..].copy_from_slice(&bytes[10..16]);
        let node = u64::from_be_bytes(node);
        let mut buf = BytesWrapper::new(buf);
        write!(
            buf,
            "{:08x}-{:04x}-{:04x}-{:02x}{:02x}-{:012x}",
            time_low, time_mid, time_hi_and_version, clock_seq_hi_and_reserved, clock_seq_low, node
        )
        .expect("BUG: Couldn't write UUID");
        core::str::from_utf8_mut(buf.into_inner()).expect("BUG: Invalid UTF8")
    }
/// Write UUID as a lowercase ASCII string into `buf`, and returns it as a
/// string.
///
/// # Examples
///
/// With an array
///
/// ```rust
/// # use nuuid::Uuid;
/// # let uuid = Uuid::new_v4();
/// let mut buf = [0u8; 36];
/// uuid.to_str(&mut buf);
/// ```
///
/// With a slice
///
/// ```rust
/// # use nuuid::Uuid;
/// # use std::convert::TryInto;
/// # let uuid = Uuid::new_v4();
/// let mut buf = [0u8; 50];
///
/// let buf: &mut [u8] = &mut buf;
/// uuid.to_str((&mut buf[..36]).try_into().unwrap());
/// ```
///
/// With a slice, incorrectly.
///
/// ```rust,should_panic
/// # use nuuid::Uuid;
/// # use std::convert::TryInto;
/// # let uuid = Uuid::new_v4();
/// let mut buf = [0u8; 50];
///
/// let buf: &mut [u8] = &mut buf;
/// uuid.to_str(buf.try_into().unwrap());
/// ```
Write UUID as a lowercase ASCII string into `buf`, and returns it as a
string.
Write UUID as a lowercase ASCII string into ` buf ` and returns it as a string .
pub fn to_str(self, buf: &mut [u8; 36]) -> &mut str {
        let bytes = self.to_bytes();
        let time_low = u32::from_be_bytes(bytes[..4].try_into().unwrap());
        let time_mid = u16::from_be_bytes(bytes[4..6].try_into().unwrap());
        let time_hi_and_version = u16::from_be_bytes(bytes[6..8].try_into().unwrap());
        let clock_seq_hi_and_reserved = u8::from_be_bytes(bytes[8..9].try_into().unwrap());
        let clock_seq_low = u8::from_be_bytes(bytes[9..10].try_into().unwrap());
        let mut node = [0; 8];
        // Leading zeros, and last 48 bits/6 bytes
        node[2..].copy_from_slice(&bytes[10..16]);
        let node = u64::from_be_bytes(node);
        let mut buf = BytesWrapper::new(buf);
        write!(
            buf,
            "{:08x}-{:04x}-{:04x}-{:02x}{:02x}-{:012x}",
            time_low, time_mid, time_hi_and_version, clock_seq_hi_and_reserved, clock_seq_low, node
        )
        .expect("BUG: Couldn't write UUID");
        core::str::from_utf8_mut(buf.into_inner()).expect("BUG: Invalid UTF8")
    }
pub fn to_str ( self , buf : & mut [ u8 ; 36 ] ) -> & mut str { let bytes = self . to_bytes ( ) ; let time_low = u32 :: from_be_bytes ( bytes [ .. 4 ] . try_into ( ) . unwrap ( ) ) ; let time_mid = u16 :: from_be_bytes ( bytes [ 4 .. 6 ] . try_into ( ) . unwrap ( ) ) ; let time_hi_and_version = u16 :: from_be_bytes ( bytes [ 6 .. 8 ] . try_into ( ) . unwrap ( ) ) ; let clock_seq_hi_and_reserved = u8 :: from_be_bytes ( bytes [ 8 .. 9 ] . try_into ( ) . unwrap ( ) ) ; let clock_seq_low = u8 :: from_be_bytes ( bytes [ 9 .. 10 ] . try_into ( ) . unwrap ( ) ) ; let mut node = [ 0 ; 8 ] ; // Leading zeros, and last 48 bits/6 bytes node [ 2 .. ] . copy_from_slice ( & bytes [ 10 .. 16 ] ) ; let node = u64 :: from_be_bytes ( node ) ; let mut buf = BytesWrapper :: new ( buf ) ; write ! ( buf " " time_low time_mid time_hi_and_version clock_seq_hi_and_reserved clock_seq_low node ) . expect ( " " ) ; core :: str :: from_utf8_mut ( buf . into_inner ( ) ) . expect ( " " ) }
Write UUID as a lowercase ASCII string into `buf`, and returns it as a
string.
Write UUID as a lowercase ASCII string into ` buf ` and returns it as a string .
self
buf
&mut [u8; 36]
examples
With an array


With an array
use nuuid::uuid;
None
let uuid = uuid::new_v4();


With a slice


With a slice
use nuuid::uuid;
None
use std::convert::tryinto;
None
let uuid = uuid::new_v4();




With a slice, incorrectly.

```rust,should_panic
With a slice incorrectly . ` ` ` rust should_panic
use nuuid::uuid;
None
use std::convert::tryinto;
None
let uuid = uuid::new_v4();
None