Struct poison::Poison [] [src]

pub struct Poison<T: ?Sized> { /* fields omitted */ }

A typed poisoning wrapper.

Enforces that access to the contained data respects poisoning.

Methods

impl<T> Poison<T>
[src]

Create a new Poison in the non-poisoned state.

Create a new Poison that is already poisoned.

Extract the data from the Poison.

Returns PoisonError if the Poison is poisoned.

impl<T: ?Sized> Poison<T>
[src]

Get a poison lock on this poison.

Returns PoisonError if the Poison is poisoned.

Heal the Poison, unpoisoning it if it is poisoned.

Get an immutable reference to the data in this poison.

There is no guard for an immutable reference, since the data must either be immutable or internally poisoned if it has interior mutability.

Get a mutable reference without a guard.

Should only be used in combination with PoisonGuard::into_raw.

Trait Implementations

impl<T: Debug + ?Sized> Debug for Poison<T>
[src]

Formats the value using the given formatter.