pub trait MapOwned: UserData {
    type Err: Debug;
    fn map_owned<F, U>(&self, op: F) -> Result<U, Self::Err>
    where
        F: FnOnce(Self::Target) -> U
; }
Expand description

Trait for wrappers that can be mapped once.

Associated Types

Required methods

Maps a T to U. Called for methods that take self. This method may fail with an error if it is called more than once on the same object.

Implementations of this method must not panic. Failures should be indicated by returning Err.

Implementors