pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new wgui context with default options (localhost, port 9080, title “wgui”).
Sourcepub fn with_port(start_port: u16) -> Self
pub fn with_port(start_port: u16) -> Self
Create a new wgui context starting port search from start_port.
Sourcepub fn with_options(opts: ContextOptions) -> Self
pub fn with_options(opts: ContextOptions) -> Self
Create a new wgui context with the given options. If no free port pair is found, the context runs in degraded (headless) mode: UI calls still work locally, but nothing is served over the network.
Sourcepub fn http_port(&self) -> u16
pub fn http_port(&self) -> u16
Returns the HTTP port the UI is served on, or 0 if running headless.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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