Skip to main content

TryContainer

Trait TryContainer 

Source
pub trait TryContainer<T: ?Sized>: FragileTryContainer<T> { }
Expand description

An abstraction over some container which owns a T and can provide immutable references to it, or be consumed to return the inner T (if T is Sized).

§Errors

The into_inner and try_get_ref methods may be able to fail, depending on the container; a container should clearly document the circumstances in which a None or Err variant may be returned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: ?Sized> TryContainer<T> for Box<T>

Available on crate features alloc only.
Source§

impl<T: ?Sized> TryContainer<T> for Rc<T>

Available on crate features alloc only.
Source§

impl<T: ?Sized> TryContainer<T> for Arc<ThreadCheckedMutex<T>>

Available on crate feature thread-checked-lock only.
Source§

impl<T: ?Sized> TryContainer<T> for Arc<T>

Available on crate features alloc only.

Implementors§

Source§

impl<T: ?Sized> TryContainer<T> for CheckedRcRefCell<T>

Available on crate features alloc only.
Source§

impl<T: ?Sized> TryContainer<T> for T