Trait supercow::ext::ConstDeref [] [src]

pub unsafe trait ConstDeref {
    type Target: ?Sized;
    fn const_deref(&self) -> &Self::Target;
}

Marker trait indicating a Deref-like which always returns the same reference.

This is not intended for general use outside Supercow. Notably, mundane references satisfy this trait's requirements, but deliberately do not implement it. It is also not a subtrait of Deref due to some additional special logic around boxes.

Unsafety

Behaviour is undefined if the implementation does not always return the same reference from const_deref() for any particular implementing value (including if that value is moved or cloned).

Associated Types

The type this value dereferences to.

Required Methods

Returns the (constant) value that this value dereferences to.

Implementors