pub struct Local<T> { /* private fields */ }
Expand description

A thread-local implementation of Lock.

This type is very similar to core::cell::RefCell but because it only supports exclusive locking it can be smaller.

Implementations

Create a new local lock around a value.

Get a unique reference to the inner value from a unique reference to the lock.

Consume this lock, returning the inner data.

Check whether the lock is currently locked.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Acquire an exclusive lock. Read more

Acquire a shared lock. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts to this type from the input type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.