pub struct Viewer { /* private fields */ }Expand description
The bot screen of one bot. Cheap to clone (a handle).
Implementations§
Source§impl Viewer
impl Viewer
Sourcepub fn new(cfg: ViewerConfig) -> Self
pub fn new(cfg: ViewerConfig) -> Self
A viewer (no server yet: see Viewer::start).
Sourcepub fn config(&self) -> &ViewerConfig
pub fn config(&self) -> &ViewerConfig
The configuration.
Sourcepub fn watch<B>(&self, behavior: B) -> Watched<B>
pub fn watch<B>(&self, behavior: B) -> Watched<B>
Wraps a behaviour so its ticks feed this viewer.
Sourcepub async fn start(&self) -> Result<SocketAddr>
pub async fn start(&self) -> Result<SocketAddr>
Starts the server (idempotent; builds the assets on first use) and returns its address.
Sourcepub fn set_status(&self, status: &str, message: &str)
pub fn set_status(&self, status: &str, message: &str)
The status line under the bot’s name on the page, and the message shown while the bot is not in game (empty: the default).
Sourcepub fn status(&self) -> ViewerStatus
pub fn status(&self) -> ViewerStatus
Running, port, pages watching, in game.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Viewer
impl !UnwindSafe for Viewer
impl Forget for Viewer
impl Freeze for Viewer
impl Move for Viewer
impl Send for Viewer
impl Sync for Viewer
impl Unpin for Viewer
impl UnsafeUnpin for Viewer
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