PhantomContravariantLifetime in core::marker - Rust

Struct PhantomContravariantLifetime 

Source

pub struct PhantomContravariantLifetime<'a>(/* private fields */);

🔬This is a nightly-only experimental API. (phantom_variance_markers #135806)

Expand description

Zero-sized type used to mark a lifetime as contravariant.

Contravariant lifetimes must live at most as long as declared. See the reference for more information.

Note: If 'a is otherwise covariant or invariant, the resulting type is invariant.

§Layout

For all 'a, the following are guaranteed:

  • size_of::<PhantomContravariantLifetime<'a>>() == 0
  • align_of::<PhantomContravariantLifetime<'a>>() == 1
Source§
Source

🔬This is a nightly-only experimental API. (phantom_variance_markers #135806)

Constructs a new instance of the variance marker.

§
§
§
§
§
§