pub fn map<U: ?Sized, F>(this: Self, cb: F) -> RwLockReadGuard<'rwlock, U>
        where F: FnOnce(&'rwlock T) -> &'rwlock U
    {
        let new = RwLockReadGuard {
            __lock: this.__lock,
            __data: cb(this.__data),
            __marker: marker::PhantomData
        };

        mem::forget(this);

        new
    }
/// Transform this guard to hold a sub-borrow of the original data.
///
/// Applies the supplied closure to the data, returning a new lock
/// guard referencing the borrow returned by the closure.
///
/// # Examples
///
/// ```rust
/// # use rwlock2::{RwLockReadGuard, RwLock};
/// let x = RwLock::new(vec![1, 2]);
///
/// let y = RwLockReadGuard::map(x.read().unwrap(), |v| &v[0]);
/// assert_eq!(*y, 1);
/// ```
Transform this guard to hold a sub-borrow of the original data.
Applies the supplied closure to the data, returning a new lock
guard referencing the borrow returned by the closure.
Transform this guard to hold a sub - borrow of the original data . Applies the supplied closure to the data returning a new lock guard referencing the borrow returned by the closure .
pub fn map<U: ?Sized, F>(this: Self, cb: F) -> RwLockReadGuard<'rwlock, U>
        where F: FnOnce(&'rwlock T) -> &'rwlock U
    {
        let new = RwLockReadGuard {
            __lock: this.__lock,
            __data: cb(this.__data),
            __marker: marker::PhantomData
        };
        mem::forget(this);
        new
    }
pub fn map < U : ? Sized , F > ( this : Self , cb : F ) -> RwLockReadGuard < ' rwlock , U > where F : FnOnce ( & ' rwlock T ) -> & ' rwlock U { let new = RwLockReadGuard { __lock : this . __lock , __data : cb ( this . __data ) , __marker : marker :: PhantomData } ; mem :: forget ( this ) ; new }
Transform this guard to hold a sub-borrow of the original data.
Transform this guard to hold a sub - borrow of the original data .
this
Self
cb
F
this
Self
cb
F
examples
None
use rwlock2::{rwlockreadguard, rwlock};
None