Skip to main content

Field

Struct Field 

Source
pub struct Field { /* private fields */ }
Expand description

The infinite 2D space containing all Nodes.

Implementations§

Source§

impl Field

Source

pub fn new() -> Self

Source

pub fn nodes(&self) -> &HashMap<NodeId, Node>

Source

pub fn node(&self, id: NodeId) -> Option<&Node>

Source

pub fn node_mut(&mut self, id: NodeId) -> Option<&mut Node>

Source

pub fn spawn_surface( &mut self, label: impl Into<String>, pos: Vec2, size: Vec2, ) -> NodeId

Spawn a basic Surface node.

Source

pub fn spawn_surface_in_active_cluster( &mut self, id: ClusterId, label: impl Into<String>, size: Vec2, ) -> Result<NodeId, ClusterWorkspaceSpawnError>

Source

pub fn spawn_surface_in_active_cluster_front( &mut self, id: ClusterId, label: impl Into<String>, size: Vec2, ) -> Result<NodeId, ClusterWorkspaceSpawnError>

Source

pub fn remove(&mut self, id: NodeId) -> Option<Node>

Remove a node from the Field.

Source

pub fn remove_node_cluster_safe( &mut self, id: NodeId, ) -> Option<(Node, Option<RemoveNodeClusterEffect>)>

Source

pub fn is_cluster_member(&self, id: NodeId) -> bool

Source

pub fn is_active_cluster_member(&self, id: NodeId) -> bool

Source

pub fn participates_in_field_dynamics(&self, id: NodeId) -> bool

Source

pub fn participates_in_field_activity(&self, id: NodeId) -> bool

Source

pub fn participates_in_field_view(&self, id: NodeId) -> bool

Source

pub fn node_ids_all(&self) -> Vec<NodeId>

Source

pub fn set_pinned(&mut self, id: NodeId, on: bool) -> bool

Set/unset movement pinning.

Source

pub fn anchor(&mut self, id: NodeId, on: bool) -> bool

Back-compat alias: previously anchor() meant “pinned in place”. Prefer set_pinned(). (We keep this to avoid churn in other modules.)

Source

pub fn set_anchor(&mut self, id: NodeId, on: bool) -> bool

Set/unset routing anchor marker.

Source

pub fn is_anchor(&self, id: NodeId) -> bool

Source

pub fn anchors(&self) -> Vec<NodeId>

Return all experience-visible anchors (stable order).

Source

pub fn carry(&mut self, id: NodeId, to: Vec2) -> bool

Carry a node to a new position (respects pinning).

Source

pub fn bounds(&self, id: NodeId) -> Option<Rect>

Axis-aligned bounds in Field space.

Source

pub fn in_view(&self, view: Rect) -> Vec<NodeId>

Return nodes that intersect the view rect AND are experience-visible.

Source

pub fn in_view_all(&self, view: Rect) -> Vec<NodeId>

Return all nodes that intersect the view rect (includes hidden nodes).

Source

pub fn is_visible(&self, id: NodeId) -> bool

True iff the node exists and is not hidden by any visibility reason.

Source

pub fn set_hidden(&mut self, id: NodeId, on: bool) -> bool

Explicit hide/show (does not touch cluster-hidden).

Source

pub fn set_detached(&mut self, id: NodeId, on: bool) -> bool

Detach/attach.

Source

pub fn touch(&mut self, id: NodeId, now_ms: u64) -> bool

Record interaction with a node.

Source

pub fn set_decay_level(&mut self, id: NodeId, level: DecayLevel) -> bool

Apply a decay level to a node by mapping it to representation state.

Source

pub fn set_state(&mut self, id: NodeId, state: NodeState) -> bool

Source

pub fn set_resize_footprint(&mut self, id: NodeId, size: Option<Vec2>) -> bool

Source

pub fn sync_active_footprint_to_intrinsic(&mut self, id: NodeId) -> bool

Source

pub fn visuals_visible(&self) -> Vec<NodeVisual>

Canonical visuals feed: for full behavior, use build_visuals() directly. These helpers delegate to the same implementation to avoid drift.

Source

pub fn visuals_in_view(&self, view: Rect) -> Vec<NodeVisual>

Source

pub fn cluster(&self, id: ClusterId) -> Option<&Cluster>

Source

pub fn cluster_ids(&self) -> Vec<ClusterId>

Source

pub fn cluster_mut(&mut self, id: ClusterId) -> Option<&mut Cluster>

Source

pub fn move_member_into_active_cluster_workspace( &mut self, id: ClusterId, member: NodeId, ) -> bool

Source

pub fn move_member_out_of_active_cluster_workspace( &mut self, id: ClusterId, member: NodeId, ) -> bool

Source

pub fn remove_cluster(&mut self, id: ClusterId) -> Option<Cluster>

Remove a cluster record (needed for cross-space transfer).

Source

pub fn insert_cluster(&mut self, cluster: Cluster)

Insert an existing cluster record (needed for cross-space transfer).

Source

pub fn create_cluster( &mut self, members: Vec<NodeId>, ) -> Result<ClusterId, ClusterCreateError>

Source

pub fn cluster_id_for_core_public(&self, core: NodeId) -> Option<ClusterId>

Source

pub fn cluster_id_for_member_public(&self, member: NodeId) -> Option<ClusterId>

Source

pub fn add_member_to_cluster( &mut self, id: ClusterId, member: NodeId, ) -> Result<(), ClusterAddMemberError>

Source

pub fn add_member_to_cluster_front( &mut self, id: ClusterId, member: NodeId, ) -> Result<(), ClusterAddMemberError>

Source

pub fn remove_member_from_cluster( &mut self, id: ClusterId, member: NodeId, ) -> Option<ClusterRemoveMemberOutcome>

Source

pub fn reorder_cluster_members( &mut self, id: ClusterId, ordered_members: Vec<NodeId>, ) -> Result<(), ClusterReorderError>

Source

pub fn promote_cluster_member_to_master( &mut self, id: ClusterId, member: NodeId, ) -> Result<(), ClusterReorderError>

Source

pub fn swap_cluster_overflow_member_with_visible( &mut self, id: ClusterId, overflow_member: NodeId, visible_member: NodeId, max_stack: usize, ) -> bool

Source

pub fn reorder_cluster_overflow_member( &mut self, id: ClusterId, member: NodeId, target_overflow_index: usize, max_stack: usize, ) -> bool

Source

pub fn cycle_cluster_stacking_members( &mut self, id: ClusterId, direction: ClusterCycleDirection, ) -> Option<NodeId>

Source

pub fn dissolve_cluster(&mut self, id: ClusterId) -> bool

Source

pub fn activate_cluster_workspace(&mut self, id: ClusterId) -> bool

Source

pub fn deactivate_cluster_workspace(&mut self, id: ClusterId) -> bool

Source

pub fn carry_cluster_by_core(&mut self, core: NodeId, to: Vec2) -> bool

Drag the cluster by its core handle.

Source

pub fn collapse_cluster(&mut self, id: ClusterId) -> Option<NodeId>

Collapse the cluster into a Core node.

Source

pub fn expand_cluster(&mut self, id: ClusterId) -> bool

Expand the cluster.

Source

pub fn insert_existing(&mut self, node: Node)

Source

pub fn clusters_iter(&self) -> impl Iterator<Item = &Cluster>

Trait Implementations§

Source§

impl Default for Field

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Field

§

impl RefUnwindSafe for Field

§

impl Send for Field

§

impl Sync for Field

§

impl Unpin for Field

§

impl UnsafeUnpin for Field

§

impl UnwindSafe for Field

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, 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.