pub struct Handle {
pub port: u16,
/* private fields */
}Expand description
A server running on its own thread; dropping it stops the server.
Fields§
§port: u16Implementations§
Source§impl Handle
impl Handle
Sourcepub fn set_library(&self, lib: Shared)
pub fn set_library(&self, lib: Shared)
Serves lib from the next request on, keeping the port. The old
library is left as it is (its owner still holds it), and the new
one joins library/history.
Sourcepub fn set_history(&self, paths: Vec<String>)
pub fn set_history(&self, paths: Vec<String>)
Replaces what library/history reports (Eagle reports its recent
libraries list), newest first. Duplicates are dropped.
Sourcepub fn set_token(&self, token: &str)
pub fn set_token(&self, token: &str)
Sets the Developer token. A request carrying it as token (in the
query string, or in a POST body) is served whatever its Host
header says. An empty token turns this off.
Sourcepub fn set_preferences(&self, preferences: Value)
pub fn set_preferences(&self, preferences: Value)
Sets the preferences application/info reports, in Eagle’s shape
({"general": {...}, "developer": {...}, ...}). Values are strings
where Eagle uses strings ("true", "false").
Sourcepub fn set_ai_search(&self, ai: Arc<dyn AiSearch>)
pub fn set_ai_search(&self, ai: Arc<dyn AiSearch>)
Hands over what answers the aiSearch/* routes. Without one they
answer that AI Search isn’t installed.
Sourcepub fn take_preferences(&self) -> Option<Value>
pub fn take_preferences(&self) -> Option<Value>
The preferences, if a request changed them since the last call or
Handle::set_preferences (preferences/collect/on and off set
general.showCollectModal).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Handle
impl !UnwindSafe for Handle
impl Freeze for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more