Docs.rs
shared-type-1.0.0
shared-type 1.0.0
Docs.rs crate page
MIT
Links
Repository
crates.io
Source
Owners
an-dr
Dependencies
Versions
37.5%
of the crate is documented
Platform
i686-pc-windows-msvc
i686-unknown-linux-gnu
x86_64-apple-darwin
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
Feature flags
docs.rs
About docs.rs
Badges
Builds
Metadata
Shorthand URLs
Download
Rustdoc JSON
Build queue
Privacy policy
Rust
Rust website
The Book
Standard Library API Reference
Rust by Example
The Cargo Guide
Clippy Documentation
shared_
type
1.0.0
Shared
Aliased Type
Trait Implementations
WithSharedInner<T>
In crate shared_
type
shared_type
Type Alias
Shared
Copy item path
Source
pub type Shared<T> =
Arc
<
Mutex
<T>>;
Aliased Type
§
pub struct Shared<T> {
/* private fields */
}
Trait Implementations
§
Source
§
impl<T>
WithSharedInner
<T> for
Shared
<T>
Source
§
fn
with_inner
<F, R>(&self, func: F) ->
Option
<R>
where F:
FnOnce
(
&mut T
) -> R,
Waits for the lock to become available and then calls the closure
Source
§
fn
try_with_inner
<F, R>(&self, func: F) ->
Option
<R>
where F:
FnOnce
(
&mut T
) -> R,
Immediately locks the mutex and calls the closure