Skip to main content

ElementContext

Struct ElementContext 

Source
pub struct ElementContext<'a, H: UiHost> {
    pub app: &'a mut H,
    pub window: AppWindowId,
    pub frame_id: FrameId,
    pub bounds: Rect,
    /* private fields */
}
Expand description

Per-frame view construction context passed to declarative element constructors.

ElementContext exposes:

  • a mutable handle to the app/host (cx.app) implementing UiHost,
  • the current window id and frame id,
  • helper constructors for common element kinds (containers, text, input, overlays, etc.),
  • access to theme and environment queries.

It is created and owned by [UiTree] and should be treated as an ephemeral, frame-scoped API.

Fields§

§app: &'a mut H§window: AppWindowId§frame_id: FrameId§bounds: Rect

Implementations§

Source§

impl<'a, H: UiHost> ElementContext<'a, H>

Source

pub fn new( app: &'a mut H, runtime: &'a mut ElementRuntime, window: AppWindowId, bounds: Rect, root: GlobalElementId, ) -> Self

Source

pub fn new_for_root_name( app: &'a mut H, runtime: &'a mut ElementRuntime, window: AppWindowId, bounds: Rect, root_name: &str, ) -> Self

Source

pub fn root_id(&self) -> GlobalElementId

Source

pub fn inherited_state<S: Any>(&self) -> Option<&S>

Returns the nearest ancestor state value of type S in the current element scope stack.

This is a lightweight building block for component-layer “provider” patterns (e.g. Radix DirectionProvider) without requiring a dedicated runtime context mechanism.

Source

pub fn inherited_state_where<S: Any>( &self, predicate: impl Fn(&S) -> bool, ) -> Option<&S>

Like inherited_state, but allows skipping “inactive” states while continuing to search.

This is useful when a state entry remains allocated but temporarily holds no active value (e.g. an Option<T> that is None outside of a scope).

Source

pub fn provided<S: Any>(&self) -> Option<&S>

Returns the nearest value installed via Self::provide for type S.

Source

pub fn provided_where<S: Any>( &self, predicate: impl Fn(&S) -> bool, ) -> Option<&S>

Like Self::provided, but allows filtering values while continuing the ancestor search.

Source

pub fn node_for_element(&self, element: GlobalElementId) -> Option<NodeId>

Returns the last known NodeId for a declarative element, if available.

This is intentionally a last-known query surface: authoritative render-time correctness paths should prefer live window-frame or attached-tree resolution instead of treating this as the current attached node.

It remains safe to call during element rendering because it reads from the ElementCx’s already borrowed window state, avoiding re-entrant UiHost::with_global_mut leases.

Source

pub fn live_node_for_element( &mut self, element: GlobalElementId, ) -> Option<NodeId>

Returns the current-frame node mapping for element, if available.

The authoritative liveness signal is the retained node_entry record being touched in the current frame (last_seen_frame == self.frame_id).

Source

pub fn focused_element(&self) -> Option<GlobalElementId>

Source

pub fn is_focused_element(&self, element: GlobalElementId) -> bool

Source

pub fn is_focus_within_element(&mut self, element: GlobalElementId) -> bool

Returns true when the currently focused element is element itself or any descendant in the declarative element tree for this window.

Source

pub fn has_active_text_selection(&self) -> bool

Source

pub fn has_active_text_selection_in_root(&self, root: GlobalElementId) -> bool

Source

pub fn last_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>

Returns the last frame’s bounds for a declarative element, if available.

This is safe to call during element rendering: it reads from the ElementCx’s already borrowed window state, avoiding re-entrant UiHost::with_global_mut leases.

Source

pub fn last_visual_bounds_for_element( &self, element: GlobalElementId, ) -> Option<Rect>

Returns the last frame’s visual bounds (post-render_transform AABB) for a declarative element, if available.

This is intended for anchored overlay policies that must track render transforms (ADR 0083) without mixing layout transforms into the layout solver.

Source

pub fn root_bounds_for_element(&self, element: GlobalElementId) -> Option<Rect>

Returns the last recorded root bounds for the element’s root, if available.

This is safe to call during element rendering for the same reason as last_bounds_for_element.

Source

pub fn take_transient(&mut self, key: u64) -> bool

Consume a transient event flag for the current element.

This returns true at most once per recorded event (clear-on-read).

Source

pub fn take_transient_for(&mut self, element: GlobalElementId, key: u64) -> bool

Consume a transient event flag for the specified element.

This returns true at most once per recorded event (clear-on-read).

Source

pub fn with_root_name<R>( &mut self, root_name: &str, f: impl FnOnce(&mut Self) -> R, ) -> R

Source

pub fn with_callsite_counters_snapshot<R>( &mut self, f: impl FnOnce(&mut Self) -> R, ) -> R

Runs f and then restores the current callsite counters to their previous state.

This is useful when you need to “probe-render” a subtree (e.g. to compute derived information like focus_within) without consuming callsite slots and disturbing subsequent element identity in the real render pass.

Source

pub fn request_frame(&mut self)

Request a window redraw (one-shot).

Use this after mutating state/models to schedule a repaint.

Notes:

  • This does not guarantee frame-driven progression. If you need to advance without input events (animations, progressive rendering), prefer request_animation_frame() or begin_continuous_frames().
  • This is not a timer: callers that need continuous progression must keep requesting frames.
Source

pub fn notify_for_animation_frame(&mut self)

Mark the nearest cache root as needing a paint notification on the next mount.

This is a lightweight way to force paint-cache roots to rerun paint (e.g. while animating opacity/transform) without necessarily requesting a new animation frame from the runner.

Source

pub fn request_animation_frame(&mut self)

Request the next animation frame for this window.

Use this for frame-driven updates that must advance without input events.

This is a one-shot request. Prefer begin_continuous_frames() when driving animations from declarative UI code.

Source

pub fn begin_continuous_frames(&mut self) -> ContinuousFrames

Begin a “continuous frames” lease for this window.

This is the preferred way for declarative UI to drive animations: while the returned lease is held, the mount pass will continue requesting animation frames.

Source

pub fn set_timer_for( &mut self, element: GlobalElementId, token: TimerToken, after: Duration, )

Request a one-shot timer event routed to the given element.

This records the timer target in the current window element runtime, enabling Event::Timer { token } to be dispatched to the element’s on_timer hook.

Source

pub fn set_timer(&mut self, token: TimerToken, after: Duration)

Request a one-shot timer event routed to the current element.

Source

pub fn cancel_timer(&mut self, token: TimerToken)

Cancel a previously requested timer and clear its routing entry for this window.

Source

pub fn scope<R>(&mut self, f: impl FnOnce(&mut Self) -> R) -> R

Source

pub fn keyed<K: Hash, R>(&mut self, key: K, f: impl FnOnce(&mut Self) -> R) -> R

Source

pub fn named<R>(&mut self, name: &str, f: impl FnOnce(&mut Self) -> R) -> R

Source

pub fn root_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

Component/internal identity lane: accesses root-scoped state stored under the current root_id().

This is keyed by (root_id, TypeId), so it is a shared slot per element root. Repeated calls with the same state type under the same root intentionally see the same state. If you need multiple independent slots of the same type, create a child scope first via Self::scope, Self::keyed, or another helper that allocates a distinct root id.

Source

pub fn with_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

👎Deprecated:

use root_state(…) for root-scoped shared element state

Compatibility alias for Self::root_state.

Prefer Self::root_state in new first-party code. Keep this alias for migration and downstream compatibility only.

Source

pub fn slot_state<S: Any, R>( &mut self, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

Component/internal identity lane: accesses helper-local state stored under a synthetic callsite-derived slot.

Unlike Self::root_state, this does not use the current root_id() directly. The slot is derived from (current_root, caller_location, call_index_at_that_location) so distinct callsites of the same state type do not collide.

This is the correct primitive for helper-owned internals that want React hook-like slot semantics without allocating a visible child scope in the element stack. The derived slot is intentionally not pushed onto the inherited-state stack, so descendants cannot observe it via Self::inherited_state.

If a helper needs to touch the same slot more than once during one render pass, either do all work inside a single closure or allocate the slot once via Self::slot_id and then use Self::state_for for repeated accesses.

When the helper may be invoked from a reorderable collection, prefer wrapping the caller in Self::keyed (or use Self::keyed_slot_state) so the surrounding identity stays stable across insertions and reordering.

Source

pub fn keyed_slot_state<K: Hash, S: Any, R>( &mut self, key: K, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

Like Self::slot_state, but derives the synthetic slot from (callsite, key).

This mirrors Self::keyed: repeated renders with the same key reuse the same state slot even if sibling order changes.

Source

pub fn slot_id(&mut self) -> GlobalElementId

Allocates a synthetic callsite-derived state slot id without pushing a child scope.

Use this when one helper invocation needs to read/write the same helper-local slot multiple times during a single render pass.

Source

pub fn keyed_slot_id<K: Hash>(&mut self, key: K) -> GlobalElementId

Like Self::slot_id, but keys the synthetic slot by (callsite, key).

This is useful for helper-local state inside reorderable collections where sibling order is not stable across renders.

Source

pub fn local_model<T: Any>(&mut self, init: impl FnOnce() -> T) -> Model<T>

Component/internal identity lane: returns a helper-local model handle stored under a synthetic callsite-derived slot.

This is the model-handle counterpart to Self::slot_state: the slot identity is local to this helper invocation and stable across frames, so callers can create copy-paste-friendly local Model<T> state without abusing root-scoped Self::with_state.

Source

pub fn local_model_keyed<K: Hash, T: Any>( &mut self, key: K, init: impl FnOnce() -> T, ) -> Model<T>

Like Self::local_model, but keys the synthetic slot by (callsite, key).

Prefer this when one helper is invoked from a reorderable collection or when several local models are authored through a shared helper and need explicit, stable names.

Source

pub fn state_for<S: Any, R>( &mut self, element: GlobalElementId, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

Accesses state stored under an explicit element identity.

Source

pub fn with_state_for<S: Any, R>( &mut self, element: GlobalElementId, init: impl FnOnce() -> S, f: impl FnOnce(&mut S) -> R, ) -> R

👎Deprecated:

use state_for(…) for explicit-identity element state

Compatibility alias for Self::state_for.

Prefer Self::state_for in new first-party code. Keep this alias for migration and downstream compatibility only.

Source

pub fn model_for<T: Any>( &mut self, element: GlobalElementId, init: impl FnOnce() -> T, ) -> Model<T>

Component/internal identity lane: returns a model handle stored under an explicit element identity.

This is the explicit-identity counterpart to Self::local_model and Self::local_model_keyed. Prefer it when a helper must bind a Model<T> to a stable overlay/portal/root id instead of a callsite-derived slot.

Like Self::state_for, storage is keyed by (element, TypeId). Different model value types may therefore share one explicit element id, while multiple models of the same type still need distinct explicit ids.

Source

pub fn provide<S: Any, R>( &mut self, value: S, f: impl FnOnce(&mut Self) -> R, ) -> R

Installs value as an inherited provider value for the current subtree.

This is the preferred authoring surface for provider-style patterns. It keeps provider semantics separate from raw root state while still using the same element-state substrate.

Source

pub fn observe_model<T>(&mut self, model: &Model<T>, invalidation: Invalidation)

Source

pub fn read_model<T: Any, R>( &mut self, model: &Model<T>, invalidation: Invalidation, f: impl FnOnce(&mut H, &T) -> R, ) -> Result<R, ModelUpdateError>

Source

pub fn read_model_ref<T: Any, R>( &mut self, model: &Model<T>, invalidation: Invalidation, f: impl FnOnce(&T) -> R, ) -> Result<R, ModelUpdateError>

Source

pub fn get_model_copied<T: Any + Copy>( &mut self, model: &Model<T>, invalidation: Invalidation, ) -> Option<T>

Source

pub fn get_model_cloned<T: Any + Clone>( &mut self, model: &Model<T>, invalidation: Invalidation, ) -> Option<T>

Source

pub fn observe_model_id(&mut self, model: ModelId, invalidation: Invalidation)

Source

pub fn observe_global<T: Any>(&mut self, invalidation: Invalidation)

Source

pub fn observe_global_id(&mut self, global: TypeId, invalidation: Invalidation)

Source

pub fn observe_layout_query_region( &mut self, region: GlobalElementId, invalidation: Invalidation, )

Source

pub fn layout_query_bounds( &mut self, region: GlobalElementId, invalidation: Invalidation, ) -> Option<Rect>

Source

pub fn environment_viewport_bounds( &mut self, invalidation: Invalidation, ) -> Rect

Source

pub fn environment_viewport_width(&mut self, invalidation: Invalidation) -> Px

Source

pub fn environment_viewport_height(&mut self, invalidation: Invalidation) -> Px

Source

pub fn environment_scale_factor(&mut self, invalidation: Invalidation) -> f32

Source

pub fn environment_color_scheme( &mut self, invalidation: Invalidation, ) -> Option<ColorScheme>

Source

pub fn environment_prefers_reduced_motion( &mut self, invalidation: Invalidation, ) -> Option<bool>

Source

pub fn environment_text_scale_factor( &mut self, invalidation: Invalidation, ) -> Option<f32>

Source

pub fn environment_prefers_reduced_transparency( &mut self, invalidation: Invalidation, ) -> Option<bool>

Source

pub fn environment_accent_color( &mut self, invalidation: Invalidation, ) -> Option<Color>

Source

pub fn environment_prefers_contrast( &mut self, invalidation: Invalidation, ) -> Option<ContrastPreference>

Source

pub fn environment_forced_colors_mode( &mut self, invalidation: Invalidation, ) -> Option<ForcedColorsMode>

Source

pub fn environment_safe_area_insets( &mut self, invalidation: Invalidation, ) -> Option<Edges>

Source

pub fn environment_occlusion_insets( &mut self, invalidation: Invalidation, ) -> Option<Edges>

Source

pub fn environment_primary_pointer_type( &mut self, invalidation: Invalidation, ) -> PointerType

Source

pub fn environment_primary_pointer_can_hover( &mut self, invalidation: Invalidation, default_when_unknown: bool, ) -> bool

Source

pub fn environment_primary_pointer_is_coarse( &mut self, invalidation: Invalidation, default_when_unknown: bool, ) -> bool

Source

pub fn diagnostics_record_overlay_placement_anchored_panel( &mut self, overlay_root_name: Option<&str>, anchor_element: Option<GlobalElementId>, content_element: Option<GlobalElementId>, trace: AnchoredPanelLayoutTrace, )

Source

pub fn diagnostics_record_overlay_placement_placed_rect( &mut self, overlay_root_name: Option<&str>, anchor_element: Option<GlobalElementId>, content_element: Option<GlobalElementId>, outer: Rect, anchor: Rect, placed: Rect, side: Option<Side>, )

Source

pub fn theme(&mut self) -> &Theme

Source

pub fn for_each_keyed<T, K: Hash>( &mut self, items: &[T], key: impl FnMut(&T) -> K, f: impl FnMut(&mut Self, usize, &T), )

Source

pub fn for_each_unkeyed<T: Hash>( &mut self, items: &[T], f: impl FnMut(&mut Self, usize, &T), )

Source

pub fn container<I>( &mut self, props: ContainerProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn semantics<I>( &mut self, props: SemanticsProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Creates a Semantics layout wrapper around the subtree.

Semantics is intentionally input- and paint-transparent, but it does participate in layout via SemanticsProps.layout. Use it when you need a semantics node boundary (tree structure) or wrapper-only semantics features (e.g. a focusable semantics node).

If you only need to stamp test_id / label / role / value for diagnostics or UI automation, prefer attaching SemanticsDecoration to an existing element via AnyElement::attach_semantics(...) to avoid introducing a layout node.

Source

pub fn semantic_flex<I>( &mut self, props: SemanticFlexProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn focus_scope<I>( &mut self, props: FocusScopeProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn view_cache<I>( &mut self, props: ViewCacheProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn view_cache_keep_alive<I>( &mut self, props: ViewCacheProps, keep_alive: bool, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Explicit keep-alive cache root for cases where the element producer may be skipped by view caching.

This mirrors the “reuse” side of view_cache(...), but makes the decision explicit:

  • When keep_alive=true, the subtree is kept alive even if f is not executed.
  • When keep_alive=false, f is always executed (no implicit reuse).

This is a mechanism-layer escape hatch intended for overlay synthesis and similar systems that must preserve subtree liveness when the normal authoring closure does not run.

Source

pub fn focus_scope_with_id<I>( &mut self, props: FocusScopeProps, f: impl FnOnce(&mut Self, GlobalElementId) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn layout_query_region_with_id<I>( &mut self, props: LayoutQueryRegionProps, f: impl FnOnce(&mut Self, GlobalElementId) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn layout_query_region<I>( &mut self, props: LayoutQueryRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn semantics_with_id<I>( &mut self, props: SemanticsProps, f: impl FnOnce(&mut Self, GlobalElementId) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Creates a Semantics layout wrapper around the subtree and passes its element id.

See Self::semantics for guidance on when to use Semantics vs attach_semantics (SemanticsDecoration).

Source

pub fn opacity<I>( &mut self, opacity: f32, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn opacity_props<I>( &mut self, props: OpacityProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn foreground_scope<I>( &mut self, foreground: Color, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn foreground_scope_props<I>( &mut self, props: ForegroundScopeProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn effect_layer<I>( &mut self, mode: EffectMode, chain: EffectChain, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn effect_layer_props<I>( &mut self, props: EffectLayerProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn backdrop_source_group_v1<I>( &mut self, pyramid: Option<CustomEffectPyramidRequestV1>, quality: EffectQuality, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn backdrop_source_group_v1_props<I>( &mut self, props: BackdropSourceGroupProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn mask_layer<I>( &mut self, mask: Mask, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn mask_layer_props<I>( &mut self, props: MaskLayerProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn composite_group<I>( &mut self, mode: BlendMode, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn composite_group_props<I>( &mut self, props: CompositeGroupProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn visual_transform<I>( &mut self, transform: Transform2D, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn render_transform<I>( &mut self, transform: Transform2D, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn fractional_render_transform<I>( &mut self, translate_x_fraction: f32, translate_y_fraction: f32, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn visual_transform_props<I>( &mut self, props: VisualTransformProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn render_transform_props<I>( &mut self, props: RenderTransformProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn fractional_render_transform_props<I>( &mut self, props: FractionalRenderTransformProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn anchored_props<I>( &mut self, props: AnchoredProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn interactivity_gate<I>( &mut self, present: bool, interactive: bool, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn interactivity_gate_props<I>( &mut self, props: InteractivityGateProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn hit_test_gate<I>( &mut self, hit_test: bool, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn hit_test_gate_props<I>( &mut self, props: HitTestGateProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn focus_traversal_gate<I>( &mut self, traverse: bool, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn focus_traversal_gate_props<I>( &mut self, props: FocusTraversalGateProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn pressable<I>( &mut self, props: PressableProps, f: impl FnOnce(&mut Self, PressableState) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn pressable_with_id<I>( &mut self, props: PressableProps, f: impl FnOnce(&mut Self, PressableState, GlobalElementId) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn pressable_with_id_props<I>( &mut self, f: impl FnOnce(&mut Self, PressableState, GlobalElementId) -> (PressableProps, I), ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn pressable_on_activate(&mut self, handler: OnActivate)

Register a component-owned activation handler for the current pressable element.

This is a policy hook mechanism (ADR 0074): components decide what activation does (model writes, overlay requests, command dispatch), while the runtime remains mechanism-only.

Source

pub fn pressable_on_activate_for( &mut self, element: GlobalElementId, handler: OnActivate, )

Source

pub fn pressable_add_on_activate(&mut self, handler: OnActivate)

Source

pub fn pressable_add_on_activate_for( &mut self, element: GlobalElementId, handler: OnActivate, )

Source

pub fn pressable_clear_on_activate(&mut self)

Source

pub fn selectable_text_on_activate_span( &mut self, handler: OnSelectableTextActivateSpan, )

Register a component-owned activation handler for interactive spans in the current selectable text element.

This is a policy hook mechanism (ADR 0074): components decide what activation does (open URL, dispatch command, etc.), while the runtime remains mechanism-only.

Source

pub fn selectable_text_on_activate_span_for( &mut self, element: GlobalElementId, handler: OnSelectableTextActivateSpan, )

Source

pub fn selectable_text_clear_on_activate_span(&mut self)

Source

pub fn selectable_text_clear_on_activate_span_for( &mut self, element: GlobalElementId, )

Source

pub fn pressable_on_pointer_down(&mut self, handler: OnPressablePointerDown)

Register a component-owned pointer down handler for the current pressable element.

This is a policy hook mechanism (ADR 0074): components can opt into Radix-style “select on mouse down” semantics without changing the default click-like activation behavior.

Source

pub fn pressable_on_pointer_move(&mut self, handler: OnPressablePointerMove)

Source

pub fn pressable_on_pointer_up(&mut self, handler: OnPressablePointerUp)

Source

pub fn pressable_on_clipboard_write_completed( &mut self, handler: OnPressableClipboardWriteCompleted, )

Source

pub fn pressable_on_pointer_down_for( &mut self, element: GlobalElementId, handler: OnPressablePointerDown, )

Source

pub fn pressable_on_pointer_move_for( &mut self, element: GlobalElementId, handler: OnPressablePointerMove, )

Source

pub fn pressable_on_pointer_up_for( &mut self, element: GlobalElementId, handler: OnPressablePointerUp, )

Source

pub fn pressable_on_clipboard_write_completed_for( &mut self, element: GlobalElementId, handler: OnPressableClipboardWriteCompleted, )

Source

pub fn pressable_add_on_pointer_down(&mut self, handler: OnPressablePointerDown)

Source

pub fn pressable_add_on_pointer_move(&mut self, handler: OnPressablePointerMove)

Source

pub fn pressable_add_on_pointer_up(&mut self, handler: OnPressablePointerUp)

Source

pub fn pressable_add_on_pointer_down_for( &mut self, element: GlobalElementId, handler: OnPressablePointerDown, )

Source

pub fn pressable_add_on_pointer_move_for( &mut self, element: GlobalElementId, handler: OnPressablePointerMove, )

Source

pub fn pressable_add_on_pointer_up_for( &mut self, element: GlobalElementId, handler: OnPressablePointerUp, )

Source

pub fn pressable_clear_on_pointer_down(&mut self)

Source

pub fn pressable_clear_on_pointer_move(&mut self)

Source

pub fn pressable_clear_on_pointer_up(&mut self)

Source

pub fn pressable_clear_on_clipboard_write_completed(&mut self)

Source

pub fn pressable_on_hover_change(&mut self, handler: OnHoverChange)

Register a component-owned hover change handler for the current pressable element.

This is a mechanism-only hook: the runtime tracks hover deterministically and invokes component code on hover transitions, without baking hover policy into fret-ui.

Source

pub fn pressable_add_on_hover_change(&mut self, handler: OnHoverChange)

Source

pub fn pressable_clear_on_hover_change(&mut self)

Source

pub fn pointer_region<I>( &mut self, props: PointerRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn text_input_region<I>( &mut self, props: TextInputRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn internal_drag_region<I>( &mut self, props: InternalDragRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn internal_drag_region_on_internal_drag(&mut self, handler: OnInternalDrag)

Source

pub fn internal_drag_region_clear_on_internal_drag(&mut self)

Source

pub fn external_drag_region<I>( &mut self, props: ExternalDragRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn external_drag_region_on_external_drag(&mut self, handler: OnExternalDrag)

Source

pub fn external_drag_region_clear_on_external_drag(&mut self)

Source

pub fn pointer_region_on_pointer_down(&mut self, handler: OnPointerDown)

Register a component-owned pointer down handler for the current pointer region element.

This is a mechanism-only hook point: components decide what a pointer down does (open a context menu, start a drag, request focus, etc.), while the runtime remains policy-free.

Source

pub fn pointer_region_add_on_pointer_down(&mut self, handler: OnPointerDown)

Source

pub fn pointer_region_clear_on_pointer_down(&mut self)

Source

pub fn pointer_region_on_pointer_move(&mut self, handler: OnPointerMove)

Register a component-owned pointer move handler for the current pointer region element.

This hook is invoked when the pointer region receives PointerEvent::Move events via normal hit-testing or pointer capture.

Source

pub fn pointer_region_add_on_pointer_move(&mut self, handler: OnPointerMove)

Source

pub fn pointer_region_clear_on_pointer_move(&mut self)

Source

pub fn pointer_region_on_pointer_up(&mut self, handler: OnPointerUp)

Register a component-owned pointer up handler for the current pointer region element.

This hook is invoked when the pointer region receives PointerEvent::Up events via normal hit-testing or pointer capture.

Source

pub fn pointer_region_on_pointer_cancel(&mut self, handler: OnPointerCancel)

Register a component-owned pointer cancel handler for the current pointer region element.

This hook is invoked when the runtime receives Event::PointerCancel for a pointer stream that was previously interacting with this region (typically via pointer capture).

Source

pub fn pointer_region_on_wheel(&mut self, handler: OnWheel)

Source

pub fn pointer_region_on_pinch_gesture(&mut self, handler: OnPinchGesture)

Source

pub fn pointer_region_add_on_pointer_up(&mut self, handler: OnPointerUp)

Source

pub fn pointer_region_add_on_wheel(&mut self, handler: OnWheel)

Source

pub fn pointer_region_add_on_pinch_gesture(&mut self, handler: OnPinchGesture)

Source

pub fn pointer_region_clear_on_pointer_up(&mut self)

Source

pub fn pointer_region_clear_on_wheel(&mut self)

Source

pub fn pointer_region_clear_on_pinch_gesture(&mut self)

Source

pub fn text_input_region_on_text_input( &mut self, handler: OnTextInputRegionTextInput, )

Source

pub fn text_input_region_clear_on_text_input(&mut self)

Source

pub fn text_input_region_on_ime(&mut self, handler: OnTextInputRegionIme)

Source

pub fn text_input_region_clear_on_ime(&mut self)

Source

pub fn text_input_region_on_clipboard_read_text( &mut self, handler: OnTextInputRegionClipboardReadText, )

Source

pub fn text_input_region_clear_on_clipboard_read_text(&mut self)

Source

pub fn text_input_region_on_clipboard_read_failed( &mut self, handler: OnTextInputRegionClipboardReadFailed, )

Source

pub fn text_input_region_clear_on_clipboard_read_failed(&mut self)

Source

pub fn text_input_region_on_set_selection( &mut self, handler: OnTextInputRegionSetSelection, )

Source

pub fn text_input_region_clear_on_set_selection(&mut self)

Source

pub fn text_input_region_on_platform_text_input_query( &mut self, handler: OnTextInputRegionPlatformTextInputQuery, )

Source

pub fn text_input_region_clear_on_platform_text_input_query(&mut self)

Source

pub fn text_input_region_on_platform_text_input_replace_text_in_range_utf16( &mut self, handler: OnTextInputRegionPlatformTextInputReplaceTextInRangeUtf16, )

Source

pub fn text_input_region_clear_on_platform_text_input_replace_text_in_range_utf16( &mut self, )

Source

pub fn text_input_region_on_platform_text_input_replace_and_mark_text_in_range_utf16( &mut self, handler: OnTextInputRegionPlatformTextInputReplaceAndMarkTextInRangeUtf16, )

Source

pub fn text_input_region_clear_on_platform_text_input_replace_and_mark_text_in_range_utf16( &mut self, )

Source

pub fn key_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_on_key_down_focused_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_add_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_prepend_on_key_down_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_clear_on_key_down_for(&mut self, element: GlobalElementId)

Source

pub fn key_clear_on_key_down_focused_for(&mut self, element: GlobalElementId)

Source

pub fn key_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_add_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_prepend_on_key_down_capture_for( &mut self, element: GlobalElementId, handler: OnKeyDown, )

Source

pub fn key_clear_on_key_down_capture_for(&mut self, element: GlobalElementId)

Source

pub fn command_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )

Source

pub fn action_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommand, )

Source

pub fn action_add_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommand, )

Source

pub fn action_clear_on_command_for_owner<Owner: Any>( &mut self, element: GlobalElementId, )

Source

pub fn command_add_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )

Source

pub fn command_prepend_on_command_for( &mut self, element: GlobalElementId, handler: OnCommand, )

Source

pub fn command_clear_on_command_for(&mut self, element: GlobalElementId)

Source

pub fn command_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )

Source

pub fn action_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )

Source

pub fn action_add_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )

Source

pub fn action_clear_on_command_availability_for_owner<Owner: Any>( &mut self, element: GlobalElementId, )

Source

pub fn command_add_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )

Source

pub fn command_prepend_on_command_availability_for( &mut self, element: GlobalElementId, handler: OnCommandAvailability, )

Source

pub fn command_clear_on_command_availability_for( &mut self, element: GlobalElementId, )

Source

pub fn timer_on_timer_for(&mut self, element: GlobalElementId, handler: OnTimer)

Source

pub fn timer_add_on_timer_for( &mut self, element: GlobalElementId, handler: OnTimer, )

Source

pub fn timer_clear_on_timer_for(&mut self, element: GlobalElementId)

Source

pub fn dismissible_on_dismiss_request(&mut self, handler: OnDismissRequest)

Register a component-owned dismiss handler for the current dismissible root element.

This is intended for overlay policy code that composes render_dismissible_root_with_hooks(...) and wants full control over dismissal semantics (ADR 0074).

Source

pub fn dismissible_on_pointer_move(&mut self, handler: OnDismissiblePointerMove)

Register a component-owned pointer-move observer for the current dismissible root element.

This is used for overlay policies that need global pointer movement (e.g. submenu safe-hover corridors) without making the overlay hit-testable outside its content.

Source

pub fn dismissible_add_on_dismiss_request(&mut self, handler: OnDismissRequest)

Source

pub fn dismissible_add_on_pointer_move( &mut self, handler: OnDismissiblePointerMove, )

Source

pub fn dismissible_clear_on_dismiss_request(&mut self)

Source

pub fn dismissible_clear_on_pointer_move(&mut self)

Source

pub fn roving_on_active_change(&mut self, handler: OnRovingActiveChange)

Register a component-owned roving active-change handler for the current roving element.

This hook is invoked when the roving container changes focus among its children due to keyboard navigation (arrow keys, Home/End, or typeahead).

Components can implement “automatic activation” (e.g. Tabs) by updating selection models here, keeping selection policy out of the runtime (ADR 0074).

Source

pub fn roving_add_on_active_change(&mut self, handler: OnRovingActiveChange)

Source

pub fn roving_clear_on_active_change(&mut self)

Source

pub fn roving_on_typeahead(&mut self, handler: OnRovingTypeahead)

Register a component-owned roving typeahead handler for the current roving element.

When set, the runtime forwards alphanumeric key presses to this handler so components can decide how typeahead should work (buffering, prefix matching, wrapping, etc.).

Source

pub fn roving_add_on_typeahead(&mut self, handler: OnRovingTypeahead)

Source

pub fn roving_clear_on_typeahead(&mut self)

Source

pub fn roving_on_key_down(&mut self, handler: OnKeyDown)

Source

pub fn roving_add_on_key_down(&mut self, handler: OnKeyDown)

Source

pub fn roving_clear_on_key_down(&mut self)

Source

pub fn roving_on_navigate(&mut self, handler: OnRovingNavigate)

Register a component-owned roving navigation handler for the current roving element.

This is invoked for key down events that bubble through the roving container so component code can decide which child should become focused (arrow keys, Home/End, etc.).

Source

pub fn roving_add_on_navigate(&mut self, handler: OnRovingNavigate)

Source

pub fn roving_clear_on_navigate(&mut self)

Source

pub fn stack<I>(&mut self, f: impl FnOnce(&mut Self) -> I) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn stack_props<I>( &mut self, props: StackProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn column<I>( &mut self, props: ColumnProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn row<I>( &mut self, props: RowProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn spacer(&mut self, props: SpacerProps) -> AnyElement

Source

pub fn text(&mut self, text: impl Into<Arc<str>>) -> AnyElement

Source

pub fn text_props(&mut self, props: TextProps) -> AnyElement

Source

pub fn styled_text(&mut self, rich: AttributedText) -> AnyElement

Source

pub fn styled_text_props(&mut self, props: StyledTextProps) -> AnyElement

Source

pub fn selectable_text(&mut self, rich: AttributedText) -> AnyElement

Source

pub fn selectable_text_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> SelectableTextProps, ) -> AnyElement

Source

pub fn selectable_text_props( &mut self, props: SelectableTextProps, ) -> AnyElement

Source

pub fn text_input(&mut self, props: TextInputProps) -> AnyElement

Source

pub fn text_input_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> TextInputProps, ) -> AnyElement

Source

pub fn text_area(&mut self, props: TextAreaProps) -> AnyElement

Source

pub fn text_area_with_id_props( &mut self, f: impl FnOnce(&mut Self, GlobalElementId) -> TextAreaProps, ) -> AnyElement

Source

pub fn resizable_panel_group<I>( &mut self, props: ResizablePanelGroupProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn image(&mut self, image: ImageId) -> AnyElement

Source

pub fn image_props(&mut self, props: ImageProps) -> AnyElement

Source

pub fn canvas( &mut self, props: CanvasProps, paint: impl for<'p> Fn(&mut CanvasPainter<'p>) + 'static, ) -> AnyElement

Source

pub fn viewport_surface(&mut self, target: RenderTargetId) -> AnyElement

Source

pub fn viewport_surface_mapped( &mut self, target: RenderTargetId, target_px_size: (u32, u32), fit: ViewportFit, ) -> AnyElement

Source

pub fn viewport_surface_props( &mut self, props: ViewportSurfaceProps, ) -> AnyElement

Source

pub fn svg_icon(&mut self, svg: SvgSource) -> AnyElement

Source

pub fn svg_icon_props(&mut self, props: SvgIconProps) -> AnyElement

Source

pub fn spinner(&mut self) -> AnyElement

Source

pub fn spinner_props(&mut self, props: SpinnerProps) -> AnyElement

Source

pub fn hover_region<I>( &mut self, props: HoverRegionProps, f: impl FnOnce(&mut Self, bool) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn wheel_region<I>( &mut self, props: WheelRegionProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn scroll<I>( &mut self, props: ScrollProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn scrollbar(&mut self, props: ScrollbarProps) -> AnyElement

Source

pub fn virtual_list<F, I>( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, f: F, ) -> AnyElement
where F: FnOnce(&mut Self, &[VirtualItem]) -> I, I: IntoIterator<Item = AnyElement>,

Source

pub fn virtual_list_with_range_extractor<F, I>( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, f: F, ) -> AnyElement
where F: FnOnce(&mut Self, &[VirtualItem]) -> I, I: IntoIterator<Item = AnyElement>,

Source

pub fn virtual_list_with_layout<F, I>( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, f: F, ) -> AnyElement
where F: FnOnce(&mut Self, &[VirtualItem]) -> I, I: IntoIterator<Item = AnyElement>,

Source

pub fn virtual_list_with_layout_and_range_extractor<F, I>( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, f: F, ) -> AnyElement
where F: FnOnce(&mut Self, &[VirtualItem]) -> I, I: IntoIterator<Item = AnyElement>,

Source

pub fn flex<I>( &mut self, props: FlexProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn roving_flex<I>( &mut self, props: RovingFlexProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn grid<I>( &mut self, props: GridProps, f: impl FnOnce(&mut Self) -> I, ) -> AnyElement
where I: IntoIterator<Item = AnyElement>,

Source

pub fn virtual_list_keyed( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl FnMut(usize) -> ItemKey, row: impl FnMut(&mut Self, usize) -> AnyElement, ) -> AnyElement

Virtualized list helper that enforces stable element identity by entering a keyed scope for each visible row.

Prefer this over index-identity list rendering for any dynamic collection that can reorder, so element-local state (caret/selection/scroll) does not “stick to positions”.

Source

pub fn virtual_list_keyed_retained( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: Arc<dyn Fn(usize) -> ItemKey>, row: Arc<dyn for<'a> Fn(&mut ElementContext<'a, H>, usize) -> AnyElement>, ) -> AnyElement
where H: 'static,

Retained-host VirtualList helper (ADR 0192).

This is an opt-in surface that stores 'static row callbacks in element-local state so the runtime can attach/detach row subtrees when a cache root reuses without rerendering.

Source

pub fn virtual_list_keyed_retained_fn( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl Fn(usize) -> ItemKey + 'static, row: impl for<'b> Fn(&mut ElementContext<'b, H>, usize) -> AnyElement + 'static, ) -> AnyElement
where H: 'static,

Source

pub fn virtual_list_keyed_retained_with_layout( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: Arc<dyn Fn(usize) -> ItemKey>, row: Arc<dyn for<'a> Fn(&mut ElementContext<'a, H>, usize) -> AnyElement>, ) -> AnyElement
where H: 'static,

Source

pub fn virtual_list_keyed_retained_with_layout_fn( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl Fn(usize) -> ItemKey + 'static, row: impl for<'b> Fn(&mut ElementContext<'b, H>, usize) -> AnyElement + 'static, ) -> AnyElement
where H: 'static,

Source

pub fn virtual_list_keyed_retained_with_layout_and_range_extractor( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: Arc<dyn Fn(usize) -> ItemKey>, range_extractor: fn(VirtualRange) -> Vec<usize>, row: Arc<dyn for<'a> Fn(&mut ElementContext<'a, H>, usize) -> AnyElement>, ) -> AnyElement
where H: 'static,

Source

pub fn virtual_list_keyed_retained_with_layout_and_range_extractor_fn( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl Fn(usize) -> ItemKey + 'static, range_extractor: fn(VirtualRange) -> Vec<usize>, row: impl for<'b> Fn(&mut ElementContext<'b, H>, usize) -> AnyElement + 'static, ) -> AnyElement
where H: 'static,

Source

pub fn virtual_list_keyed_with_range_extractor( &mut self, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl FnMut(usize) -> ItemKey, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, row: impl FnMut(&mut Self, usize) -> AnyElement, ) -> AnyElement

Source

pub fn virtual_list_keyed_with_layout( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl FnMut(usize) -> ItemKey, row: impl FnMut(&mut Self, usize) -> AnyElement, ) -> AnyElement

Source

pub fn virtual_list_keyed_with_layout_and_range_extractor( &mut self, layout: LayoutStyle, len: usize, options: VirtualListOptions, scroll_handle: &VirtualListScrollHandle, key_at: impl FnMut(usize) -> ItemKey, range_extractor: impl FnOnce(VirtualRange) -> Vec<usize>, row: impl FnMut(&mut Self, usize) -> AnyElement, ) -> AnyElement

Trait Implementations§

Source§

impl<'a, H: UiHost> ElementContextAccess<'a, H> for ElementContext<'a, H>

Source§

fn elements(&mut self) -> &mut ElementContext<'a, H>

Auto Trait Implementations§

§

impl<'a, H> Freeze for ElementContext<'a, H>

§

impl<'a, H> !RefUnwindSafe for ElementContext<'a, H>

§

impl<'a, H> !Send for ElementContext<'a, H>

§

impl<'a, H> !Sync for ElementContext<'a, H>

§

impl<'a, H> Unpin for ElementContext<'a, H>

§

impl<'a, H> UnsafeUnpin for ElementContext<'a, H>

§

impl<'a, H> !UnwindSafe for ElementContext<'a, H>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more