Skip to main content
QAROS Rust API Dev (main) · versions: Dev (main) · Developer Guide

GuiPanels

Struct GuiPanels 

Source
pub struct GuiPanels<'session> { /* private fields */ }
Expand description

GUI panel operations of a session (session.gui_panels()).

Implementations§

Source§

impl<'session> GuiPanels<'session>

Source

pub fn get_or_create(&self, config: &GuiPanelConfig) -> Result<GuiPanelId>

Returns the panel named by config.common_name, creating it if needed. Idempotent.

Source

pub fn set_pose(&self, panel: GuiPanelId, pose: Pose) -> Result<()>

Moves the panel (top-edge midpoint, room space; see GuiPanelConfig::pose).

Source

pub fn set_size(&self, panel: GuiPanelId, size: GuiPanelSize) -> Result<()>

Changes the panel’s size and content scale (qar_gui_panels_change_size).

Source

pub fn set_state(&self, panel: GuiPanelId, state: GuiPanelState) -> Result<()>

Sets the panel’s state: visible, minimized or hidden (qar_gui_panels_set_state).

Source

pub fn navigate_to_uri(&self, panel: GuiPanelId, uri: &str) -> Result<()>

Points the panel at web content.

Source

pub fn set_display_name( &self, panel: GuiPanelId, display_name: &str, ) -> Result<()>

Replaces the label shown above the panel, any content type (qar_gui_panels_change_display_name). The rules of GuiPanelConfig::display_name apply: a refused name is GUI_PANEL_DISPLAY_NAME_INVALID, never shortened, and the panel keeps its previous name. An empty string shows no name.

Source

pub fn set_served_content( &self, panel: GuiPanelId, content: &GuiPanelServedContent, ) -> Result<()>

Shows another page, or another bundle of this session, on a served panel (qar_gui_panels_set_served_content). A bundle another session published is PANEL_CONTENT_NOT_PUBLISHER; a website or stream panel is GUI_PANEL_CHANGE_NOT_PERMITTED, since the content type is fixed at creation.

Source

pub fn close(&self, panel: GuiPanelId) -> Result<()>

Closes and removes the panel (qar_gui_panels_close_panel).

Source

pub fn list(&self) -> Result<Vec<GuiPanelInfo>>

Snapshot of every panel in the session.

Source

pub fn subscribe( &self, callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static, ) -> Result<Subscription>

Calls callback with a snapshot whenever any panel changes. Runs on library threads.

Source

pub fn subscribe_panel( &self, panel: GuiPanelId, callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static, ) -> Result<Subscription>

Like GuiPanels::subscribe, for one panel.

Trait Implementations§

Source§

impl<'session> Debug for GuiPanels<'session>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'session> !RefUnwindSafe for GuiPanels<'session>

§

impl<'session> !Send for GuiPanels<'session>

§

impl<'session> !Sync for GuiPanels<'session>

§

impl<'session> !UnwindSafe for GuiPanels<'session>

§

impl<'session> Freeze for GuiPanels<'session>

§

impl<'session> Unpin for GuiPanels<'session>

§

impl<'session> UnsafeUnpin for GuiPanels<'session>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.