pub struct ServerOptions {Show 13 fields
pub bind: SocketAddr,
pub snapshot_rx: Receiver<ViewerSnapshot>,
pub conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>,
pub action_tx: Sender<ControllerRequest>,
pub bundle_tx: Sender<BundleRequest>,
pub receipt_tx: Sender<ReadReceiptRequest>,
pub preflight_tx: Sender<PreflightRequest>,
pub move_preparation_tx: Sender<MovePreparationRequest>,
pub client_state_tx: Sender<ClientStateRequest>,
pub dictation_tx: Sender<DictationRequest>,
pub shutdown: CancellationToken,
pub session_ttl: Duration,
pub secure_cookie: bool,
/* private fields */
}Expand description
Options for the daemon’s phone service.
ServerOptions::new generates both the six-digit viewer code and an
ephemeral cookie key. A caller that wants cookies to survive server
restarts loads its key and logout records with load_cookie_credentials.
set_cookie_key installs a key for callers managing storage themselves. The
key and viewer code are intentionally omitted from Debug output.
Fields§
§bind: SocketAddr§snapshot_rx: Receiver<ViewerSnapshot>§conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>§action_tx: Sender<ControllerRequest>§bundle_tx: Sender<BundleRequest>§receipt_tx: Sender<ReadReceiptRequest>§preflight_tx: Sender<PreflightRequest>§move_preparation_tx: Sender<MovePreparationRequest>§client_state_tx: Sender<ClientStateRequest>§dictation_tx: Sender<DictationRequest>§shutdown: CancellationToken§session_ttl: DurationKeep this enabled for direct HTTPS or an HTTPS reverse proxy. It may be disabled only for an explicitly trusted HTTP development endpoint.
Implementations§
Source§impl ServerOptions
impl ServerOptions
pub fn new( bind: SocketAddr, snapshot_rx: Receiver<ViewerSnapshot>, conversation_rx: Receiver<BTreeMap<String, BrowserTranscript>>, requests: ServerRequests, ) -> AnyResult<Self>
pub fn viewer_code(&self) -> &str
pub fn login_token(&self) -> &str
Sourcepub fn set_tls_config(&mut self, config: RustlsConfig)
pub fn set_tls_config(&mut self, config: RustlsConfig)
Serve HTTPS directly using the supplied Rustls configuration. Hel’s CLI can load its persisted certificate (including a Tailscale-issued certificate) and pass it here without coupling this module to disk.
Install a persisted signing key. Rotating this value signs every phone
out and revokes QR login URLs. This does not load durable logout records;
use load_cookie_credentials for the daemon’s persisted credentials.
Load the signing key and durable logout records off the async runtime.
Sourcepub fn set_background_task_stop_tx(
&mut self,
tx: Sender<BackgroundTaskStopRequest>,
)
pub fn set_background_task_stop_tx( &mut self, tx: Sender<BackgroundTaskStopRequest>, )
Install the controller’s bounded background-task stop path.
Sourcepub fn set_api_token(&mut self, token: String)
pub fn set_api_token(&mut self, token: String)
Install the persisted bearer token for the /api/v1 routes. Rotating
it revokes every client that still holds the old one.
Sourcepub fn set_subagent_backend(&mut self, backend: Arc<dyn SubagentBackend>)
pub fn set_subagent_backend(&mut self, backend: Arc<dyn SubagentBackend>)
Install the daemon-side backend the /api/v1 routes drive sessions
through. Without it those routes answer 503.
Sourcepub fn set_preferences_path(&mut self, path: PathBuf)
pub fn set_preferences_path(&mut self, path: PathBuf)
Read the remembered default from a specific preferences file instead of the user’s own. Tests point this at a temporary path.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ServerOptions
impl !UnwindSafe for ServerOptions
impl Freeze for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl UnsafeUnpin for ServerOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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