pub struct HomeHost { /* private fields */ }Expand description
A running embedded host: manifest server + presence room in one listener.
Implementations§
Source§impl HomeHost
impl HomeHost
Sourcepub fn start(manifest_for: impl FnOnce(u16) -> String) -> Option<HomeHost>
pub fn start(manifest_for: impl FnOnce(u16) -> String) -> Option<HomeHost>
Serve a place and its presence room. Binds the first free port in the
invite range on all interfaces, then asks manifest_for to build the
served manifest for that port (it needs the port to name the room URL
guests should join). Returns None if no port binds.
pub fn port(&self) -> u16
Sourcepub fn occupant_count(&self) -> usize
pub fn occupant_count(&self) -> usize
Guests currently in the room (not counting the owner’s own connection is the caller’s business — the hub counts every occupant).
Sourcepub fn invite_locator(&self) -> String
pub fn invite_locator(&self) -> String
The invite address to hand a friend: thread://<lan-ip>:<port>.
Sourcepub fn local_room_url(&self) -> String
pub fn local_room_url(&self) -> String
The room URL the owner’s own browser joins (loopback, full path).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HomeHost
impl RefUnwindSafe for HomeHost
impl Send for HomeHost
impl Sync for HomeHost
impl Unpin for HomeHost
impl UnsafeUnpin for HomeHost
impl UnwindSafe for HomeHost
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