pub struct TauriVscodeServer { /* private fields */ }Expand description
A wrapper around VscodeServerManager tailored for use in Tauri applications.
This struct simplifies the integration of the VSCode server with Tauri by managing
the server’s lifecycle based on TauriConfig settings. It’s designed to be held
in Tauri’s application state.
The underlying VscodeServerManager is wrapped in an Arc<Mutex<>> to allow
shared mutable access from Tauri commands.
Implementations§
Source§impl TauriVscodeServer
impl TauriVscodeServer
Sourcepub async fn new(config: TauriConfig) -> Result<Self, ServerError>
pub async fn new(config: TauriConfig) -> Result<Self, ServerError>
Sourcepub async fn initialize(&self) -> Result<ServerInfo, ServerError>
pub async fn initialize(&self) -> Result<ServerInfo, ServerError>
Initializes the VSCode server.
This involves ensuring the server is downloaded/extracted (via ensure_server)
and, if config.auto_start is true, starting the server.
Returns information about the server if successful.
§Errors
Propagates errors from VscodeServerManager::ensure_server and VscodeServerManager::start.
Sourcepub async fn get_url(&self) -> String
pub async fn get_url(&self) -> String
Returns the URL where the VSCode server is expected to be listening.
This is an asynchronous operation as it requires locking the underlying manager.
Sourcepub async fn get_info(&self) -> Result<Value, ServerError>
pub async fn get_info(&self) -> Result<Value, ServerError>
Returns a JSON representation of the server’s information and configuration.
This is useful for providing server details to a Tauri frontend.
The JSON object includes serverUrl, monacoApiVersion, vscodeCommit,
platform, and serviceConfig (with baseUrl and connectionToken).
§Errors
Returns ServerError::ServerNotFound if the server info hasn’t been determined yet.