Skip to main content

MyApp

Struct MyApp 

Source
pub struct MyApp {
Show 16 fields pub(crate) tree: DockState<Tab>, pub(crate) show_session_settings: bool, pub(crate) show_connection_settings: bool, pub(crate) server_address: String, pub(crate) username: String, pub(crate) next_tab_id: u32, pub(crate) dmx_receiver: Receiver<(u8, [u8; 512])>, pub(crate) tcp_listen_receiver: Option<Receiver<TcpServerMessage>>, pub(crate) ui_event_sender: Sender<UiEvent>, pub(crate) ui_event_receiver: Receiver<UiEvent>, pub(crate) tcp_write_sender: Option<Sender<TcpClientMessage>>, pub(crate) connection_state: ConnectionState, pub(crate) role: UserRole, pub(crate) password: String, pub(crate) draft_username: String, pub(crate) draft_role: UserRole,
}
Expand description

The main GUI application state structure.

Holds the docking state tree, user session parameters, network connection states, and active communication channels between threads.

Fields§

§tree: DockState<Tab>

The docking state tree holding all open tabs (Terminals, Universes, etc.).

§show_session_settings: bool

Whether the session settings modal window is currently open.

§show_connection_settings: bool

Whether the connection settings modal window is currently open.

§server_address: String

The IP address and port of the target kernel server.

§username: String

The currently authenticated username.

§next_tab_id: u32

Counter assigned as the unique ID for the next newly created tab.

§dmx_receiver: Receiver<(u8, [u8; 512])>

Receiver channel for incoming DMX Universe packet data.

§tcp_listen_receiver: Option<Receiver<TcpServerMessage>>

Receiver channel for incoming TCP server messages.

§ui_event_sender: Sender<UiEvent>

Sender channel for emitting UI events to the controller handler.

§ui_event_receiver: Receiver<UiEvent>

Receiver channel for consuming UI events in the main event loop.

§tcp_write_sender: Option<Sender<TcpClientMessage>>

Sender channel for transmitting TCP messages to the server.

§connection_state: ConnectionState

The current state of the TCP network connection.

§role: UserRole

The active user role (e.g. Programmer, Showrunner).

§password: String

Password input buffer for authentication (cleared after login attempts).

§draft_username: String

Temporary draft username used in the session settings window.

§draft_role: UserRole

Temporary draft role selection used in the session settings window.

Implementations§

Source§

impl MyApp

Source

pub(crate) fn new(ctx: Context) -> Self

Creates a new instance of MyApp initialized with default panels, channels, and listeners.

§Arguments
  • ctx - The egui::Context reference for UI repaint signals.
Source

pub(crate) fn connect_to_server(&mut self)

Spawns the TCP client background thread to connect to the configured server_address.

Source

pub(crate) fn draw_top_bar(&mut self, ctx: &Context)

Renders the top menu bar containing connection options and window tab controls.

§Arguments
  • ctx - The egui::Context reference.
Source

pub(crate) fn draw_central_panel(&mut self, ctx: &Context)

Renders the central docking area managing all active application tabs.

§Arguments
  • ctx - The egui::Context reference.
Source

pub(crate) fn draw_connection_settings(&mut self, ctx: &Context)

Renders the modal window for configuring server IP address and triggering connections.

§Arguments
  • ctx - The egui::Context reference.
Source

pub(crate) fn draw_session_settings(&mut self, ctx: &Context)

Renders the modal window for user authentication and role selection.

§Arguments
  • ctx - The egui::Context reference.
Source

pub(crate) fn draw_bottom_bar(&mut self, ctx: &Context)

Renders the bottom status bar displaying connection status indicator, username, role, and application version.

§Arguments
  • ctx - The egui::Context reference.

Trait Implementations§

Source§

impl App for MyApp

Source§

fn update(&mut self, ctx: &Context, _frame: &mut Frame)

Main frame update callback invoked on every UI render pass.

Processes queued DMX packets, network server messages, and UI events, then renders all UI components and panels.

Source§

fn on_exit(&mut self, _gl: Option<&Context>)

Application exit callback.

Sends logout and disconnect requests to clean up network connections cleanly before shutdown.

§

fn save(&mut self, _storage: &mut dyn Storage)

Called on shutdown, and perhaps at regular intervals. Allows you to save state. Read more
§

fn auto_save_interval(&self) -> Duration

Time between automatic calls to [Self::save]
§

fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]

Background color values for the app, e.g. what is sent to gl.clearColor. Read more
§

fn persist_egui_memory(&self) -> bool

Controls whether or not the egui memory (window positions etc) will be persisted (only if the “persistence” feature is enabled).
§

fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)

A hook for manipulating or filtering raw input before it is processed by [Self::update]. Read more

Auto Trait Implementations§

§

impl !Sync for MyApp

§

impl Freeze for MyApp

§

impl RefUnwindSafe for MyApp

§

impl Send for MyApp

§

impl Unpin for MyApp

§

impl UnsafeUnpin for MyApp

§

impl UnwindSafe for MyApp

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more