pub fn try_mut(self) -> Result<BytesMut, Bytes> {
        if self.inner.is_mut_safe() {
            Ok(BytesMut { inner: self.inner })
        } else {
            Err(self)
        }
    }
/// Attempts to convert into a `BytesMut` handle.
///
/// This will only succeed if there are no other outstanding references to
/// the underlying chunk of memory. `Bytes` handles that contain inlined
/// bytes will always be convertible to `BytesMut`.
///
/// # Examples
///
/// ```
/// use ntex_bytes::Bytes;
///
/// let a = Bytes::copy_from_slice(&b"Mary had a little lamb, little lamb, little lamb..."[..]);
///
/// // Create a shallow clone
/// let b = a.clone();
///
/// // This will fail because `b` shares a reference with `a`
/// let a = a.try_mut().unwrap_err();
///
/// drop(b);
///
/// // This will succeed
/// let mut a = a.try_mut().unwrap();
///
/// a[0] = b'b';
///
/// assert_eq!(&a[..4], b"bary");
/// ```
Attempts to convert into a `BytesMut` handle.
This will only succeed if there are no other outstanding references to
the underlying chunk of memory. `Bytes` handles that contain inlined
bytes will always be convertible to `BytesMut`.
Attempts to convert into a ` BytesMut ` handle . This will only succeed if there are no other outstanding references to the underlying chunk of memory . ` Bytes ` handles that contain inlined bytes will always be convertible to ` BytesMut ` .
pub fn try_mut(self) -> Result<BytesMut, Bytes> {
        if self.inner.is_mut_safe() {
            Ok(BytesMut { inner: self.inner })
        } else {
            Err(self)
        }
    }
pub fn try_mut ( self ) -> Result < BytesMut , Bytes > { if self . inner . is_mut_safe ( ) { Ok ( BytesMut { inner : self . inner } ) } else { Err ( self ) } }
Attempts to convert into a `BytesMut` handle.
Attempts to convert into a ` BytesMut ` handle .
self
self
examples
```
use ntex_bytes::Bytes.

let a = Bytes::copy_from_slice(&b"Mary had a little lamb, little lamb, little lamb..."[..]).

Create a shallow clone
let b = a.clone().

This will fail because `b` shares a reference with `a`
let a = a.try_mut().unwrap_err().



This will succeed
let mut a = a.try_mut().unwrap().




` ` ` use ntex_bytes :: Bytes . let a = Bytes :: copy_from_slice ( &b " Mary had a little lamb little lamb little lamb ... " [ .. ] ) . Create a shallow clone let b = a . clone () . This will fail because ` b ` shares a reference with ` a ` let a = a . try_mut () . unwrap_err () . This will succeed let mut a = a . try_mut () . unwrap () .