pub struct AppService { /* private fields */ }Expand description
Blocking, UI-agnostic facade over vs_core::App.
Methods block (network/disk I/O) and MUST be called off the UI thread — the view layer runs them on gpui’s background executor.
Implementations§
Source§impl AppService
impl AppService
pub fn new(core: App) -> Self
Sourcepub fn tool_rows(&self) -> Result<Vec<ToolRow>, CoreError>
pub fn tool_rows(&self) -> Result<Vec<ToolRow>, CoreError>
Sidebar: added tools with their current version (active scope).
Sourcepub fn installed_rows(&self, name: &str) -> Result<Vec<VersionRow>, CoreError>
pub fn installed_rows(&self, name: &str) -> Result<Vec<VersionRow>, CoreError>
Detail/Installed: installed versions for a tool with the current flag.
Sourcepub fn search_available(
&self,
name: &str,
query: &str,
) -> Result<Vec<VersionRow>, CoreError>
pub fn search_available( &self, name: &str, query: &str, ) -> Result<Vec<VersionRow>, CoreError>
Detail/Available: search results, marking already-installed versions.
Sourcepub fn install_with_progress(
&self,
name: &str,
version: &str,
on_progress: &ProgressFn<'_>,
) -> Result<InstalledVersion, CoreError>
pub fn install_with_progress( &self, name: &str, version: &str, on_progress: &ProgressFn<'_>, ) -> Result<InstalledVersion, CoreError>
Install a specific version, reporting download progress via on_progress
as (downloaded_bytes, total_bytes_if_known).
Sourcepub fn use_version(
&self,
name: &str,
version: &str,
scope: ScopeChoice,
) -> Result<InstalledVersion, CoreError>
pub fn use_version( &self, name: &str, version: &str, scope: ScopeChoice, ) -> Result<InstalledVersion, CoreError>
Switch the active version for a tool in the given scope.
Sourcepub fn uninstall(
&self,
name: &str,
version: &str,
) -> Result<UninstallResult, CoreError>
pub fn uninstall( &self, name: &str, version: &str, ) -> Result<UninstallResult, CoreError>
Uninstall a specific version.
Sourcepub fn registry_plugin_names(&self) -> Result<Vec<String>, CoreError>
pub fn registry_plugin_names(&self) -> Result<Vec<String>, CoreError>
Registry plugins available to add (names).
Sourcepub fn add(&self, source: AddSource) -> Result<(), CoreError>
pub fn add(&self, source: AddSource) -> Result<(), CoreError>
Add a tool, from the registry or from a source URL/path.
Sourcepub fn update_plugin(&self, name: &str) -> Result<(), CoreError>
pub fn update_plugin(&self, name: &str) -> Result<(), CoreError>
Update a single plugin to the latest registry definition.
The refreshed RegistryEntry is discarded; the UI only needs success/failure.
Sourcepub fn remove_plugin(&self, name: &str) -> Result<bool, CoreError>
pub fn remove_plugin(&self, name: &str) -> Result<bool, CoreError>
Remove a plugin (and its installed SDKs). Returns whether it existed.
Sourcepub fn refresh_registry(&self) -> Result<usize, CoreError>
pub fn refresh_registry(&self) -> Result<usize, CoreError>
Refresh the registry index; returns the number of plugins indexed.
Trait Implementations§
Source§impl Clone for AppService
impl Clone for AppService
Source§fn clone(&self) -> AppService
fn clone(&self) -> AppService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AppService
impl RefUnwindSafe for AppService
impl Send for AppService
impl Sync for AppService
impl Unpin for AppService
impl UnsafeUnpin for AppService
impl UnwindSafe for AppService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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