Skip to main content

ZoneRegistry

Struct ZoneRegistry 

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

Manages zone allocation and plugin ownership.

Create one per application. Register plugins at startup, then query each frame for the current zone layout.

Implementations§

Source§

impl ZoneRegistry

Source

pub fn new() -> Self

Creates an empty registry.

Source

pub fn register( &mut self, plugin: Arc<dyn ZonePlugin>, ) -> Vec<RegistrationResult>

Registers a plugin and processes its zone requests.

Returns a vec of results (one per request, in order).

Source

pub fn zones_by_hint(&self, hint: ZoneHint) -> Vec<&ZoneSpec>

Returns all zones matching a hint, sorted by order.

Source

pub fn tabs(&self) -> Vec<&ZoneSpec>

Returns all tab zones, sorted by order.

Source

pub fn owner(&self, zone_id: ZoneId) -> Option<&Arc<dyn ZonePlugin>>

Returns the plugin that owns a zone.

Source

pub fn zone(&self, zone_id: ZoneId) -> Option<&ZoneSpec>

Returns a zone spec by ID.

Source

pub fn zone_by_name(&self, name: &str) -> Option<&ZoneSpec>

Returns a zone spec by name.

Source

pub fn update_area(&mut self, zone_id: ZoneId, area: Rect)

Updates the area for a zone (called by the host each frame).

Source

pub fn set_visible(&mut self, zone_id: ZoneId, visible: bool)

Sets visibility for a zone.

Source

pub fn len(&self) -> usize

Total number of registered zones.

Source

pub fn is_empty(&self) -> bool

Whether the registry has no zones.

Source

pub fn all_zones(&self) -> &[ZoneSpec]

All zones (unfiltered).

Trait Implementations§

Source§

impl Default for ZoneRegistry

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.