pub fn into_ref(self) -> Result<Ref<T>, AccessError> {
        // NB: we default to a "safer" mode with `AccessKind::Owned`, where
        // references cannot be converted to an `Mut<T>` in order to avoid
        // a potential soundness panic.
        self.internal_into_ref(AccessKind::Owned)
    }
/// Get a reference to the interior value while checking for shared access
/// that holds onto a reference count of the inner value.
///
/// This prevents other exclusive accesses from being performed while the
/// guard returned from this function is live.
///
/// # Examples
///
/// ```rust
/// use runestick::Shared;
///
/// #[derive(Debug)]
/// struct Foo {
///     counter: isize,
/// }
///
/// let a = Shared::new(Foo { counter: 0 });
/// let b = a.clone();
///
/// b.borrow_mut().unwrap().counter += 1;
///
/// {
///     // Consumes `a`.
///     let mut a = a.into_ref().unwrap();
///     assert_eq!(a.counter, 1);
///     assert!(b.borrow_mut().is_err());
/// }
///
/// let mut b = b.borrow_mut().unwrap();
/// b.counter += 1;
/// assert_eq!(b.counter, 2);
/// ```
Get a reference to the interior value while checking for shared access
that holds onto a reference count of the inner value.

This prevents other exclusive accesses from being performed while the
guard returned from this function is live.
Get a reference to the interior value while checking for shared access that holds onto a reference count of the inner value . This prevents other exclusive accesses from being performed while the guard returned from this function is live .
pub fn into_ref(self) -> Result<Ref<T>, AccessError> {
        // NB: we default to a "safer" mode with `AccessKind::Owned`, where
        // references cannot be converted to an `Mut<T>` in order to avoid
        // a potential soundness panic.
        self.internal_into_ref(AccessKind::Owned)
    }
pub fn into_ref ( self ) -> Result < Ref < T > , AccessError > { // NB: we default to a "safer" mode with `AccessKind::Owned`, where // references cannot be converted to an `Mut<T>` in order to avoid // a potential soundness panic. self . internal_into_ref ( AccessKind :: Owned ) }
Get a reference to the interior value while checking for shared access
that holds onto a reference count of the inner value.
Get a reference to the interior value while checking for shared access that holds onto a reference count of the inner value .
self
self
examples
```rust
use runestick::Shared.
` ` ` rust use runestick :: Shared .
[derive(debug)]
struct Foo {
counter: isize,
}

let a = Shared::new(Foo { counter: 0 });
let b = a.clone().

b.borrow_mut().unwrap().counter += 1.

{
Consumes `a`.
let mut a = a.into_ref().unwrap();
assert_eq!(a.counter, 1);
assert!(b.borrow_mut().is_err());
}


struct Foo { counter : isize } let a = Shared :: new ( Foo { counter : 0 } ) ; let b = a . clone () . b . borrow_mut () . unwrap () . counter + = 1 . { Consumes ` a ` . let mut a = a . into_ref () . unwrap () ; assert_eq! ( a . counter 1 ) ; assert! ( b . borrow_mut () . is_err () ) ; }