# [−][src]Trait lock_api::RawMutexTimed

    pub unsafe trait RawMutexTimed: RawMutex {
        type Duration;
        type Instant;
        fn try_lock_for(&self, timeout: Self::Duration) -> bool;
        fn try_lock_until(&self, timeout: Self::Instant) -> bool;
    }

Additional methods for mutexes which support locking with timeouts.

The `Duration` and `Instant` types are specified as associated types so that this trait is usable even in `no_std` environments.

## Associated Types

### `type Duration`

Duration type used for `try_lock_for`.

### `type Instant`

Instant type used for `try_lock_until`.

Loading content...

## Required methods

### `fn try_lock_for(&self, timeout: Self::Duration) -> bool`

Attempts to acquire this lock until a timeout is reached.

### `fn try_lock_until(&self, timeout: Self::Instant) -> bool`

Attempts to acquire this lock until a timeout is reached.

Loading content...

## Implementors

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## 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`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)