pub trait VineHost: Send + Sync {
Show 15 methods
// Required methods
fn ApplicationState(&self) -> &dyn ApplicationStateAccess;
fn EmitToRenderer(&self, Channel: &str, Payload: Value);
fn RendererEmitter(&self) -> Arc<dyn RendererEmitter> ⓘ;
fn IPCProvider(&self) -> Arc<dyn IPCProvider> ⓘ;
fn UnregisterProvider(&self, Handle: u32);
fn RegisterCommandInRegistry(
&self,
CommandId: &str,
SideCarIdentifier: &str,
);
fn UnregisterCommandInRegistry(&self, CommandId: &str);
fn SpawnSendTextToTerminal(&self, TerminalId: u64, Text: String);
fn SpawnDisposeTerminal(&self, TerminalId: u64);
fn CreateTerminal<'a>(
&'a self,
Options: &'a Value,
) -> BoxFuture<'a, Option<Value>>;
fn RegisterScmInRegistry(
&self,
Handle: u32,
ScmId: &str,
Label: &str,
ExtId: &str,
);
fn CreateSourceControl<'a>(&'a self, Payload: Value) -> BoxFuture<'a, ()>;
fn UpdateSourceControlGroup<'a>(
&'a self,
ScmHandle: u32,
Payload: Value,
) -> BoxFuture<'a, ()>;
fn RegisterLanguageProvider(
&self,
Handle: u32,
TypeName: &str,
Payload: &Value,
) -> bool;
fn UpdateScmGroupMarkers(
&self,
ScmHandle: u32,
GroupId: &str,
ResourceStates: &Value,
);
}Expand description
The embedder-facing seam between Vine and its host runtime.
Implementations belong in the embedder crate (Mountain, Air, …), not in Vine.
Required Methods§
Sourcefn ApplicationState(&self) -> &dyn ApplicationStateAccess
fn ApplicationState(&self) -> &dyn ApplicationStateAccess
Returns the embedder’s application state for handler use.
Sourcefn EmitToRenderer(&self, Channel: &str, Payload: Value)
fn EmitToRenderer(&self, Channel: &str, Payload: Value)
Emits a JSON event on the named renderer channel. No-op for embedders that have no renderer (e.g. Air).
Sourcefn RendererEmitter(&self) -> Arc<dyn RendererEmitter> ⓘ
fn RendererEmitter(&self) -> Arc<dyn RendererEmitter> ⓘ
Returns a cheap-to-clone renderer event sink. Used by handlers with long-lived flushers that need to emit from a background task without borrowing the full host.
Sourcefn IPCProvider(&self) -> Arc<dyn IPCProvider> ⓘ
fn IPCProvider(&self) -> Arc<dyn IPCProvider> ⓘ
Returns the cross-channel IPC provider. Used by handlers that need to
re-enter the IPC bus (e.g. tree-view registration that needs to call
sky:replay-events).
Sourcefn UnregisterProvider(&self, Handle: u32)
fn UnregisterProvider(&self, Handle: u32)
Unregisters a provider by handle. Embedders that maintain a provider
registry route this to their ProviderRegistration table; embedders
without a registry silently discard.
Sourcefn RegisterCommandInRegistry(&self, CommandId: &str, SideCarIdentifier: &str)
fn RegisterCommandInRegistry(&self, CommandId: &str, SideCarIdentifier: &str)
Inserts a proxied command into the embedder’s command dispatch registry.
SideCarIdentifier is the gRPC sidecar to proxy to (e.g.
"cocoon-main"). No-op for embedders without a command registry.
Sourcefn UnregisterCommandInRegistry(&self, CommandId: &str)
fn UnregisterCommandInRegistry(&self, CommandId: &str)
Removes a command from the embedder’s dispatch registry. No-op for embedders without a command registry.
Sourcefn SpawnSendTextToTerminal(&self, TerminalId: u64, Text: String)
fn SpawnSendTextToTerminal(&self, TerminalId: u64, Text: String)
Spawns a background task that sends Text to the PTY identified by
TerminalId. No-op for embedders without terminal support.
Sourcefn SpawnDisposeTerminal(&self, TerminalId: u64)
fn SpawnDisposeTerminal(&self, TerminalId: u64)
Spawns a background task that disposes the PTY identified by
TerminalId. No-op for embedders without terminal support.
Sourcefn CreateTerminal<'a>(
&'a self,
Options: &'a Value,
) -> BoxFuture<'a, Option<Value>>
fn CreateTerminal<'a>( &'a self, Options: &'a Value, ) -> BoxFuture<'a, Option<Value>>
Creates a new PTY terminal with the given options JSON and returns
Some({ "id": u64, "pid": u64, "name": string }) on success, None
on failure or for embedders without terminal support.
Sourcefn RegisterScmInRegistry(
&self,
Handle: u32,
ScmId: &str,
Label: &str,
ExtId: &str,
)
fn RegisterScmInRegistry( &self, Handle: u32, ScmId: &str, Label: &str, ExtId: &str, )
Registers an SCM provider in the embedder’s ProviderRegistration
table. Called once per vscode.scm.createSourceControl(...)
invocation.
Sourcefn CreateSourceControl<'a>(&'a self, Payload: Value) -> BoxFuture<'a, ()>
fn CreateSourceControl<'a>(&'a self, Payload: Value) -> BoxFuture<'a, ()>
Forwards a CreateSourceControl call to the embedder’s
SourceControlManagementProvider. Errors are logged internally.
Sourcefn UpdateSourceControlGroup<'a>(
&'a self,
ScmHandle: u32,
Payload: Value,
) -> BoxFuture<'a, ()>
fn UpdateSourceControlGroup<'a>( &'a self, ScmHandle: u32, Payload: Value, ) -> BoxFuture<'a, ()>
Forwards an UpdateSourceControlGroup call to the embedder’s
SourceControlManagementProvider. Errors are logged internally.
Sourcefn RegisterLanguageProvider(
&self,
Handle: u32,
TypeName: &str,
Payload: &Value,
) -> bool
fn RegisterLanguageProvider( &self, Handle: u32, TypeName: &str, Payload: &Value, ) -> bool
Registers a language-feature provider by normalised type name.
TypeName is the wire method stripped of register_ prefix and
optional _provider suffix (e.g. "hover", "completion_item").
Returns true if the type was recognised and the registration was
inserted; false for unknown type names (no-op embedders always return
false).
Sourcefn UpdateScmGroupMarkers(
&self,
ScmHandle: u32,
GroupId: &str,
ResourceStates: &Value,
)
fn UpdateScmGroupMarkers( &self, ScmHandle: u32, GroupId: &str, ResourceStates: &Value, )
Persists a resource-state snapshot for an SCM group in the embedder’s
SCM marker registry. ScmHandle is the provider handle,
GroupId identifies the group within that provider, and
ResourceStates is the raw JSON array of resource state objects.
No-op for embedders without SCM marker support.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".