# Struct bitflags::__core::sync::RwLockReadGuard [−] [src]

    #[must_use]
    pub struct RwLockReadGuard<'a, T> where T: 'a + ?Sized {
        // some fields omitted
    }

1.0.0

RAII structure used to release the shared read access of a lock when dropped.

## Methods

### `impl<'rwlock, T> RwLockReadGuard<'rwlock, T> where T: ?Sized`

#### `fn map<U, F>(this: RwLockReadGuard<'rwlock, T>, cb: F) -> RwLockReadGuard<'rwlock, U> where U: ?Sized, F: FnOnce(&T) -> &U`

Deprecated since 1.8.0

: unsound on Mutex because of Condvar and RwLock may also with to be used with Condvar one day

Unstable (`guard_map`)

: unsound on Mutex because of Condvar and RwLock may also with to be used with Condvar one day

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

    let x = RwLock::new(vec![1, 2]);

    let y = RwLockReadGuard::map(x.read().unwrap(), |v| &v[0]);
    assert_eq!(*y, 1);

## Trait Implementations

### `impl<'a, T> !Send for RwLockReadGuard<'a, T> where T: ?Sized`

### `impl<'rwlock, T> Deref for RwLockReadGuard<'rwlock, T> where T: ?Sized`

#### `type Target = T`

#### `fn deref(&self) -> &T`

### `impl<'a, T> Drop for RwLockReadGuard<'a, T> where T: ?Sized`

#### `fn drop(&mut self)`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)