Skip to main content

World

Struct World 

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

Multiple independent infinite Fields (one per monitor space), plus optional adjacency (portals) between them.

Implementations§

Source§

impl World

Source

pub fn new() -> Self

Source

pub fn add_space(&mut self, id: SpaceId, field: Field)

Source

pub fn space(&self, id: SpaceId) -> Option<&Field>

Source

pub fn space_mut(&mut self, id: SpaceId) -> Option<&mut Field>

Source

pub fn set_neighbor(&mut self, a: SpaceId, dir: PortalDir, b: SpaceId)

Define a portal edge from a in direction dir to b. You typically set both directions (a->b and b->a).

Source

pub fn neighbor(&self, a: SpaceId, dir: PortalDir) -> Option<SpaceId>

Source

pub fn transfer_node( &mut self, from_space: SpaceId, node: NodeId, dir: PortalDir, from_vp: &Viewport, to_vp: &Viewport, ) -> bool

Move a single node from one space to its neighbor space through dir. The compositor should call this ONLY when the “transfer modifier” is held.

Source

pub fn transfer_cluster_by_core( &mut self, from_space: SpaceId, core: NodeId, dir: PortalDir, from_vp: &Viewport, to_vp: &Viewport, ) -> bool

Move a cluster by its core handle across spaces. This moves the core + members as a unit by rehoming all involved nodes.

Trait Implementations§

Source§

impl Default for World

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for World

§

impl RefUnwindSafe for World

§

impl Send for World

§

impl Sync for World

§

impl Unpin for World

§

impl UnsafeUnpin for World

§

impl UnwindSafe for World

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.