Trait MapOwned

Source
pub trait MapOwned: UserData {
    type Err: Debug;

    // Required method
    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.

Required Associated Types§

Required Methods§

Source

fn map_owned<F, U>(&self, op: F) -> Result<U, Self::Err>
where F: FnOnce(Self::Target) -> U,

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.

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.

Implementors§