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
impl ZoneRegistry
Sourcepub fn register(
&mut self,
plugin: Arc<dyn ZonePlugin>,
) -> Vec<RegistrationResult>
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).
Sourcepub fn zones_by_hint(&self, hint: ZoneHint) -> Vec<&ZoneSpec>
pub fn zones_by_hint(&self, hint: ZoneHint) -> Vec<&ZoneSpec>
Returns all zones matching a hint, sorted by order.
Sourcepub fn owner(&self, zone_id: ZoneId) -> Option<&Arc<dyn ZonePlugin>>
pub fn owner(&self, zone_id: ZoneId) -> Option<&Arc<dyn ZonePlugin>>
Returns the plugin that owns a zone.
Sourcepub fn zone_by_name(&self, name: &str) -> Option<&ZoneSpec>
pub fn zone_by_name(&self, name: &str) -> Option<&ZoneSpec>
Returns a zone spec by name.
Sourcepub fn update_area(&mut self, zone_id: ZoneId, area: Rect)
pub fn update_area(&mut self, zone_id: ZoneId, area: Rect)
Updates the area for a zone (called by the host each frame).
Sourcepub fn set_visible(&mut self, zone_id: ZoneId, visible: bool)
pub fn set_visible(&mut self, zone_id: ZoneId, visible: bool)
Sets visibility for a zone.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ZoneRegistry
impl !RefUnwindSafe for ZoneRegistry
impl Send for ZoneRegistry
impl Sync for ZoneRegistry
impl Unpin for ZoneRegistry
impl UnsafeUnpin for ZoneRegistry
impl !UnwindSafe for ZoneRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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