pub struct SettingsOverlay { /* private fields */ }Expand description
The settings overlay: a menu of options, each of which opens a pane.
Implementations§
Source§impl SettingsOverlay
impl SettingsOverlay
pub fn new( config_options: &[LocalConfigOption], server_statuses: Vec<McpServerStatusEntry>, auth_methods: &[AuthMethod], ) -> Self
Sourcepub fn upsert_local_entries(&mut self, entries: Vec<SettingsMenuEntry>)
pub fn upsert_local_entries(&mut self, entries: Vec<SettingsMenuEntry>)
Adds the given rows, replacing any already shown for the same option.
Sourcepub fn add_status_entries(&mut self)
pub fn add_status_entries(&mut self)
Adds the rows that open panes rather than pick a config value.
pub fn update_config_options(&mut self, options: &[LocalConfigOption])
pub fn apply_change(&mut self, change: &SettingsChange)
pub fn update_server_statuses(&mut self, statuses: Vec<McpServerStatusEntry>)
pub fn update_auth_methods(&mut self, methods: &[AuthMethod])
pub fn on_authenticate_started(&mut self, method_id: &str)
pub fn on_authenticate_complete(&mut self, method_id: &str)
pub fn on_authenticate_failed(&mut self, method_id: &str)
Sourcepub fn on_elicitation_request(
&mut self,
params: CreateElicitationRequest,
responder: Responder<CreateElicitationResponse>,
browser_opener: Arc<dyn Fn(&str) -> Result<(), String> + Send + Sync>,
clipboard_writer: Arc<dyn Fn(&str) -> Result<(), String> + Send + Sync>,
)
pub fn on_elicitation_request( &mut self, params: CreateElicitationRequest, responder: Responder<CreateElicitationResponse>, browser_opener: Arc<dyn Fn(&str) -> Result<(), String> + Send + Sync>, clipboard_writer: Arc<dyn Fn(&str) -> Result<(), String> + Send + Sync>, )
Queues the request for the overlay to answer in place, against the given host handlers so tests observe URL opens without spawning a browser.
Sourcepub fn cancel_pending_elicitation(&mut self)
pub fn cancel_pending_elicitation(&mut self)
Drops an unanswered request, which cancels it.
Source§impl SettingsOverlay
impl SettingsOverlay
Sourcepub fn on_ui_event(&mut self, event: UiEvent) -> Vec<SettingsOutput>
pub fn on_ui_event(&mut self, event: UiEvent) -> Vec<SettingsOutput>
Routes every event to whichever of the three things inside the overlay owns input, innermost first.
One entry point rather than one override per event kind, because the triage is the same for all of them — and because only routing them together makes “a request closing returns focus to the pane behind it” hold for a click as reliably as it does for a keystroke.
Auto Trait Implementations§
impl !RefUnwindSafe for SettingsOverlay
impl !Sync for SettingsOverlay
impl !UnwindSafe for SettingsOverlay
impl Freeze for SettingsOverlay
impl Send for SettingsOverlay
impl Unpin for SettingsOverlay
impl UnsafeUnpin for SettingsOverlay
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.