pub fn try_map<M, U: ?Sized>(this: Self, m: M) -> Option<BorrowMut<'a, U>>
    where
        M: FnOnce(&mut T) -> Option<&mut U>,
    {
        Some(BorrowMut {
            data: m(this.data)?,
            guard: this.guard,
        })
    }
/// Try to map the mutable reference to a projection.
///
/// # Examples
///
/// ```rust
/// use runestick::{BorrowMut, Shared};
///
/// # fn main() -> runestick::Result<()> {
/// let vec = Shared::<Vec<u32>>::new(vec![1, 2, 3, 4]);
/// let vec = vec.borrow_mut()?;
/// let mut value: Option<BorrowMut<[u32]>> = BorrowMut::try_map(vec, |vec| vec.get_mut(0..2));
///
/// assert_eq!(value.as_deref_mut(), Some(&mut [1u32, 2u32][..]));
/// # Ok(()) }
/// ```
Try to map the mutable reference to a projection.
Try to map the mutable reference to a projection .
pub fn try_map<M, U: ?Sized>(this: Self, m: M) -> Option<BorrowMut<'a, U>>
    where
        M: FnOnce(&mut T) -> Option<&mut U>,
    {
        Some(BorrowMut {
            data: m(this.data)?,
            guard: this.guard,
        })
    }
pub fn try_map < M , U : ? Sized > ( this : Self , m : M ) -> Option < BorrowMut < ' a , U > > where M : FnOnce ( & mut T ) -> Option < & mut U > , { Some ( BorrowMut { data : m ( this . data ) ? , guard : this . guard , } ) }
Try to map the mutable reference to a projection.
Try to map the mutable reference to a projection .
this
Self
m
M
this
Self
m
M
examples
```rust
use runestick::{BorrowMut, Shared}.
` ` ` rust use runestick :: { BorrowMut Shared } .
fn main() -> runestick::result<()> {
None
ok(()) }
None