Skip to main content

sidecar_get

Function sidecar_get 

Source
#[doc(hidden)]
pub fn sidecar_get<O, T>( ptr: &impl SidecarOwner<O>, index: usize, name: &'static str, field: fn(&O) -> &Sidecar<T>, ) -> T
Expand description

Reads T’s Sidecar field index of the object ptr holds, after moving the field’s pending value into the slot.

Called by the getters #[derive(ExternalPtr)] generates (T::field(&ptr)); field selects the struct’s Sidecar field.

§Panics

Off R’s main thread, naming the field, before touching R; or when the slot does not convert to T.