pub struct Server { /* private fields */ }Expand description
A running control server. Dropping it closes the port and every open connection, and removes the key file.
Implementations§
Source§impl Server
impl Server
Sourcepub fn start(
config: Config,
wake: impl Fn() + Send + Sync + 'static,
) -> Result<(Server, Receiver<Request>), ControlError>
pub fn start( config: Config, wake: impl Fn() + Send + Sync + 'static, ) -> Result<(Server, Receiver<Request>), ControlError>
Bind, write the key file and serve. Requests arrive on the returned receiver; poll it on the
app thread (each frame) and answer with crate::handle or Request::reply. wake is
called after each request is queued (request a repaint).
pub fn port(&self) -> u16
Sourcepub fn key(&self) -> &str
pub fn key(&self) -> &str
The key requests must carry (to hand to a trusted in-process client or child).
pub fn key_file(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Forget for Server
impl Freeze for Server
impl Move for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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