Skip to main content

MountainVinegRPCService

Struct MountainVinegRPCService 

Source
pub struct MountainVinegRPCService {
    ApplicationHandle: AppHandle,
    RunTime: Arc<ApplicationRunTime>,
    ActiveOperations: Arc<RwLock<HashMap<u64, CancellationToken>>>,
}
Expand description

The concrete implementation of the MountainService gRPC service.

This service handles all incoming RPC calls from the Cocoon sidecar, validating requests, dispatching to appropriate handlers, and returning responses in the expected gRPC format.

Fields§

§ApplicationHandle: AppHandle

Tauri application handle for VS Code integration

§RunTime: Arc<ApplicationRunTime>

Application runtime containing core dependencies

§ActiveOperations: Arc<RwLock<HashMap<u64, CancellationToken>>>

Registry of active operations with their cancellation tokens Maps request ID to cancellation token for operation cancellation

Implementations§

Source§

impl MountainVinegRPCService

Source

pub fn ApplicationHandle(&self) -> &AppHandle

Accessor for Tauri AppHandle - used by the per-wire-method atoms in Vine::Server::Notification::* that need to emit sky:// / cocoon:* events downstream. Kept as a thin read so the struct’s fields can stay private; atoms should never mutate the handle, only emit through it.

Source

pub fn RunTime(&self) -> &Arc<ApplicationRunTime>

Accessor for the shared ApplicationRunTime. Notification atoms reach Environment.ApplicationState.* (provider registry, extension registry, scheduler) through this. Clone from Arc when the atom needs to keep it across an .await boundary.

Source§

impl MountainVinegRPCService

Source

pub fn Create( ApplicationHandle: AppHandle, RunTime: Arc<ApplicationRunTime>, ) -> Self

Creates a new instance of the Mountain gRPC service.

§Parameters
  • ApplicationHandle: Tauri app handle for framework integration
  • RunTime: Application runtime with core dependencies
§Returns

New MountainVinegRPCService instance

Source

pub async fn RegisterOperation(&self, request_id: u64) -> CancellationToken

Registers an operation for potential cancellation

§Parameters
  • request_id: The request identifier for the operation
§Returns

A cancellation token that can be used to cancel the operation

Source

pub async fn UnregisterOperation(&self, request_id: u64)

Unregisters an operation after completion

§Parameters
  • request_id: The request identifier to unregister
Source

fn ValidateRequest(&self, request: &GenericRequest) -> Result<(), Status>

Validates a generic request before processing.

§Parameters
  • request: The request to validate
§Returns
  • Ok(()): Request is valid
  • Err(Status): Validation failed with appropriate gRPC status
Source

fn CreateErrorResponse( RequestIdentifier: u64, code: i32, message: String, data: Option<Vec<u8>>, ) -> GenericResponse

Creates a JSON-RPC compliant error response.

§Parameters
  • RequestIdentifier: The request ID to echo back
  • code: JSON-RPC error code
  • message: Error message
  • data: Optional error data (serialized)
§Returns

GenericResponse with error populated

Source

fn CreateSuccessResponse( RequestIdentifier: u64, result: &Value, ) -> GenericResponse

Creates a successful JSON-RPC response.

§Parameters
  • RequestIdentifier: The request ID to echo back
  • result: Result value to serialize
§Returns

GenericResponse with result populated, or error if serialization fails

Trait Implementations§

Source§

impl MountainService for MountainVinegRPCService

Source§

fn process_cocoon_request<'life0, 'async_trait>( &'life0 self, request: Request<GenericRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GenericResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles generic request-response RPCs from Cocoon.

This is the main entry point for Cocoon to request operations from Mountain. It validates the request, deserializes parameters, dispatches to the Track module, and returns the result or error in JSON-RPC format.

§Parameters
  • request: GenericRequest containing method name and serialized parameters
§Returns
  • Ok(Response<GenericResponse>): Response with result or error
  • Err(Status): gRPC status error (only for critical failures)
Source§

fn send_cocoon_notification<'life0, 'async_trait>( &'life0 self, request: Request<GenericNotification>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles generic fire-and-forget notifications from Cocoon.

Notifications do not expect a response beyond acknowledgment. They are used for status updates, events, and other asynchronous notifications.

§Parameters
  • request: GenericNotification with method name and parameters
§Returns
  • Ok(Response<Empty>): Notification was received and logged
  • Err(Status): Critical error during processing
§TODO

Future implementation should route notifications to dedicated handlers:

let Parameter: Value = serde_json::from_slice(&notification.parameter)?;
NotificationHandler::Handle(MethodName, Parameter).await?;
Source§

fn cancel_operation<'life0, 'async_trait>( &'life0 self, request: Request<CancelOperationRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles a request from Cocoon to cancel a long-running operation.

This method is called when Cocoon wants to cancel an operation that was previously initiated via process_cocoon_request.

§Parameters
  • request: CancelOperationRequest with the request ID to cancel
§Returns
  • Ok(Response<Empty>): Cancellation was initiated
  • Err(Status): Critical error during cancellation
Source§

type OpenChannelFromCocoonStream = Pin<Box<dyn Stream<Item = Result<Envelope, Status>> + Send>>

Server streaming response type for the OpenChannelFromCocoon method.
Source§

fn open_channel_from_cocoon<'life0, 'async_trait>( &'life0 self, _request: Request<Streaming<Envelope>>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::OpenChannelFromCocoonStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

LAND-PATCH B7-S6 P2: bidirectional streaming channel. Read more
Source§

impl VineHost for MountainVinegRPCService

Source§

fn ApplicationState(&self) -> &dyn ApplicationStateAccess

Returns the embedder’s application state for handler use.
Source§

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).
Source§

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.
Source§

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).
Source§

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.
Source§

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.
Source§

fn UnregisterCommandInRegistry(&self, CommandId: &str)

Removes a command from the embedder’s dispatch registry. No-op for embedders without a command registry.
Source§

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.
Source§

fn SpawnDisposeTerminal(&self, TerminalId: u64)

Spawns a background task that disposes the PTY identified by TerminalId. No-op for embedders without terminal support.
Source§

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.
Source§

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.
Source§

fn CreateSourceControl<'a>(&'a self, Payload: Value) -> BoxFuture<'a, ()>

Forwards a CreateSourceControl call to the embedder’s SourceControlManagementProvider. Errors are logged internally.
Source§

fn UpdateSourceControlGroup<'a>( &'a self, ScmHandle: u32, Payload: Value, ) -> BoxFuture<'a, ()>

Forwards an UpdateSourceControlGroup call to the embedder’s SourceControlManagementProvider. Errors are logged internally.
Source§

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).
Source§

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoRequestExt for T

Source§

fn into_request(self) -> Request<Self>
where Self: Sized,

§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,