Skip to main content

LateField

Trait LateField 

Source
pub unsafe trait LateField<S: LateStruct>:
    Sized
    + 'static
    + LateFieldSealed<S> {
    type Value: 'static + Default;

    // Required methods
    fn raw_descriptor() -> &'static RawLateFieldDescriptor;
    fn coerce(value: *mut Self::Value) -> *mut S::EraseTo;

    // Provided method
    fn descriptor() -> &'static LateFieldDescriptor<S> { ... }
}
Expand description

A trait for a marker type representing a field in a late-initialized structure.

This trait cannot be implemented manually. Instead, it should be implemented using the late_field! macro. Most documentation for this trait can be found there.

§Safety

This trait can only be safely implemented through the late_field! macro.

Required Associated Types§

Source

type Value: 'static + Default

The type of this field’s value.

Required Methods§

Source

fn raw_descriptor() -> &'static RawLateFieldDescriptor

Fetches the untyped descriptor associated with this field.

See LateField::descriptor for a typed version of this method.

Source

fn coerce(value: *mut Self::Value) -> *mut S::EraseTo

Coerces a pointer to the field’s concrete value to its unsized form expected used in LateStruct::EraseTo.

Provided Methods§

Source

fn descriptor() -> &'static LateFieldDescriptor<S>

Fetches the strongly-typed descriptor associated with this field.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§