CocoonServiceClient

Struct CocoonServiceClient 

Source
pub struct CocoonServiceClient<T> {
    inner: Grpc<T>,
}
Expand description

Service running on the Cocoon sidecar, listening for requests from Mountain.

Fields§

§inner: Grpc<T>

Implementations§

Source§

impl CocoonServiceClient<Channel>

Source

pub async fn connect<D>(dst: D) -> Result<Self, Error>
where D: TryInto<Endpoint>, D::Error: Into<StdError>,

Attempt to create a new client by connecting to a given endpoint.

Source§

impl<T> CocoonServiceClient<T>
where T: GrpcService<Body>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

Source

pub fn new(inner: T) -> Self

Source

pub fn with_origin(inner: T, origin: Uri) -> Self

Source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> CocoonServiceClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>, <T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,

Source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

Source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

Source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

Source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

Source

pub async fn process_mountain_request( &mut self, request: impl IntoRequest<GenericRequest>, ) -> Result<Response<GenericResponse>, Status>

A generic request-response method for Mountain to call a function on Cocoon.

Source

pub async fn send_mountain_notification( &mut self, request: impl IntoRequest<GenericNotification>, ) -> Result<Response<Empty>, Status>

A generic fire-and-forget method for Mountain to send a notification to Cocoon.

Source

pub async fn cancel_operation( &mut self, request: impl IntoRequest<CancelOperationRequest>, ) -> Result<Response<Empty>, Status>

A method for Mountain to request that Cocoon cancel a long-running operation.

Source

pub async fn initial_handshake( &mut self, request: impl IntoRequest<Empty>, ) -> Result<Response<Empty>, Status>

Handshake - Called by Cocoon to signal readiness

Source

pub async fn init_extension_host( &mut self, request: impl IntoRequest<InitExtensionHostRequest>, ) -> Result<Response<Empty>, Status>

Initialize Extension Host - Mountain sends initialization data to Cocoon

Source

pub async fn register_command( &mut self, request: impl IntoRequest<RegisterCommandRequest>, ) -> Result<Response<Empty>, Status>

Register Command - Cocoon registers an extension command

Source

pub async fn execute_contributed_command( &mut self, request: impl IntoRequest<ExecuteCommandRequest>, ) -> Result<Response<ExecuteCommandResponse>, Status>

Execute Contributed Command - Mountain executes an extension command

Source

pub async fn unregister_command( &mut self, request: impl IntoRequest<UnregisterCommandRequest>, ) -> Result<Response<Empty>, Status>

Unregister Command - Unregister a previously registered command

Source

pub async fn register_hover_provider( &mut self, request: impl IntoRequest<RegisterProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Hover Provider - Register a hover provider

Source

pub async fn provide_hover( &mut self, request: impl IntoRequest<ProvideHoverRequest>, ) -> Result<Response<ProvideHoverResponse>, Status>

Provide Hover - Request hover information

Source

pub async fn register_completion_item_provider( &mut self, request: impl IntoRequest<RegisterProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Completion Item Provider - Register a completion provider

Source

pub async fn provide_completion_items( &mut self, request: impl IntoRequest<ProvideCompletionItemsRequest>, ) -> Result<Response<ProvideCompletionItemsResponse>, Status>

Provide Completion Items - Request completion items

Source

pub async fn register_definition_provider( &mut self, request: impl IntoRequest<RegisterProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Definition Provider - Register a definition provider

Source

pub async fn provide_definition( &mut self, request: impl IntoRequest<ProvideDefinitionRequest>, ) -> Result<Response<ProvideDefinitionResponse>, Status>

Provide Definition - Request definition location

Source

pub async fn register_reference_provider( &mut self, request: impl IntoRequest<RegisterProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Reference Provider - Register a reference provider

Source

pub async fn provide_references( &mut self, request: impl IntoRequest<ProvideReferencesRequest>, ) -> Result<Response<ProvideReferencesResponse>, Status>

Provide References - Request references

Source

pub async fn register_code_actions_provider( &mut self, request: impl IntoRequest<RegisterProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Code Actions Provider - Register code actions provider

Source

pub async fn provide_code_actions( &mut self, request: impl IntoRequest<ProvideCodeActionsRequest>, ) -> Result<Response<ProvideCodeActionsResponse>, Status>

Provide Code Actions - Request code actions

Source

pub async fn show_text_document( &mut self, request: impl IntoRequest<ShowTextDocumentRequest>, ) -> Result<Response<ShowTextDocumentResponse>, Status>

Show Text Document - Open a text document

Source

pub async fn show_information_message( &mut self, request: impl IntoRequest<ShowMessageRequest>, ) -> Result<Response<ShowMessageResponse>, Status>

Show Information Message - Display an info message

Source

pub async fn show_warning_message( &mut self, request: impl IntoRequest<ShowMessageRequest>, ) -> Result<Response<ShowMessageResponse>, Status>

Show Warning Message - Display a warning message

Source

pub async fn show_error_message( &mut self, request: impl IntoRequest<ShowMessageRequest>, ) -> Result<Response<ShowMessageResponse>, Status>

Show Error Message - Display an error message

Source

pub async fn create_status_bar_item( &mut self, request: impl IntoRequest<CreateStatusBarItemRequest>, ) -> Result<Response<CreateStatusBarItemResponse>, Status>

Create Status Bar Item - Create a status bar item

Source

pub async fn set_status_bar_text( &mut self, request: impl IntoRequest<SetStatusBarTextRequest>, ) -> Result<Response<Empty>, Status>

Set Status Bar Text - Set status bar text

Source

pub async fn create_webview_panel( &mut self, request: impl IntoRequest<CreateWebviewPanelRequest>, ) -> Result<Response<CreateWebviewPanelResponse>, Status>

Create Webview Panel - Create a new webview panel

Source

pub async fn set_webview_html( &mut self, request: impl IntoRequest<SetWebviewHtmlRequest>, ) -> Result<Response<Empty>, Status>

Set Webview HTML - Update webview HTML content

Source

pub async fn on_did_receive_message( &mut self, request: impl IntoRequest<OnDidReceiveMessageRequest>, ) -> Result<Response<Empty>, Status>

On Did Receive Message - Receive message from webview

Source

pub async fn read_file( &mut self, request: impl IntoRequest<ReadFileRequest>, ) -> Result<Response<ReadFileResponse>, Status>

Read File - Read file contents

Source

pub async fn write_file( &mut self, request: impl IntoRequest<WriteFileRequest>, ) -> Result<Response<Empty>, Status>

Write File - Write file contents

Source

pub async fn stat( &mut self, request: impl IntoRequest<StatRequest>, ) -> Result<Response<StatResponse>, Status>

Stat - Get file metadata

Source

pub async fn readdir( &mut self, request: impl IntoRequest<ReaddirRequest>, ) -> Result<Response<ReaddirResponse>, Status>

Read Directory - List directory contents

Source

pub async fn watch_file( &mut self, request: impl IntoRequest<WatchFileRequest>, ) -> Result<Response<Empty>, Status>

Watch File - Watch file for changes

Source

pub async fn find_files( &mut self, request: impl IntoRequest<FindFilesRequest>, ) -> Result<Response<FindFilesResponse>, Status>

Find Files - Search for files

Source

pub async fn find_text_in_files( &mut self, request: impl IntoRequest<FindTextInFilesRequest>, ) -> Result<Response<FindTextInFilesResponse>, Status>

Find Text in Files - Search for text across files

Source

pub async fn open_document( &mut self, request: impl IntoRequest<OpenDocumentRequest>, ) -> Result<Response<OpenDocumentResponse>, Status>

Open Document - Open a document

Source

pub async fn save_all( &mut self, request: impl IntoRequest<SaveAllRequest>, ) -> Result<Response<SaveAllResponse>, Status>

Save All - Save all open documents

Source

pub async fn apply_edit( &mut self, request: impl IntoRequest<ApplyEditRequest>, ) -> Result<Response<ApplyEditResponse>, Status>

Apply Edit - Apply a text edit to a document

Source

pub async fn update_configuration( &mut self, request: impl IntoRequest<UpdateConfigurationRequest>, ) -> Result<Response<Empty>, Status>

Update Configuration - Notify of configuration changes

Source

pub async fn update_workspace_folders( &mut self, request: impl IntoRequest<UpdateWorkspaceFoldersRequest>, ) -> Result<Response<Empty>, Status>

Update Workspace Folders - Update workspace folders

Source

pub async fn open_terminal( &mut self, request: impl IntoRequest<OpenTerminalRequest>, ) -> Result<Response<Empty>, Status>

Open Terminal - Open a new terminal

Source

pub async fn terminal_input( &mut self, request: impl IntoRequest<TerminalInputRequest>, ) -> Result<Response<Empty>, Status>

Terminal Input - Send input to terminal

Source

pub async fn close_terminal( &mut self, request: impl IntoRequest<CloseTerminalRequest>, ) -> Result<Response<Empty>, Status>

Close Terminal - Close a terminal

Source

pub async fn accept_terminal_opened( &mut self, request: impl IntoRequest<TerminalOpenedNotification>, ) -> Result<Response<Empty>, Status>

Accept Terminal Opened - Notification: Terminal opened

Source

pub async fn accept_terminal_closed( &mut self, request: impl IntoRequest<TerminalClosedNotification>, ) -> Result<Response<Empty>, Status>

Accept Terminal Closed - Notification: Terminal closed

Source

pub async fn accept_terminal_process_id( &mut self, request: impl IntoRequest<TerminalProcessIdNotification>, ) -> Result<Response<Empty>, Status>

Accept Terminal Process ID - Notification: Terminal process ID

Source

pub async fn accept_terminal_process_data( &mut self, request: impl IntoRequest<TerminalDataNotification>, ) -> Result<Response<Empty>, Status>

Accept Terminal Process Data - Notification: Terminal output

Source

pub async fn register_tree_view_provider( &mut self, request: impl IntoRequest<RegisterTreeViewProviderRequest>, ) -> Result<Response<Empty>, Status>

Register Tree View Provider - Register a tree view provider

Source

pub async fn get_tree_children( &mut self, request: impl IntoRequest<GetTreeChildrenRequest>, ) -> Result<Response<GetTreeChildrenResponse>, Status>

Get Tree Children - Request tree view children

Source

pub async fn register_scm_provider( &mut self, request: impl IntoRequest<RegisterScmProviderRequest>, ) -> Result<Response<Empty>, Status>

Register SCM Provider - Register source control provider

Source

pub async fn update_scm_group( &mut self, request: impl IntoRequest<UpdateScmGroupRequest>, ) -> Result<Response<Empty>, Status>

Update SCM Group - Update SCM group

Source

pub async fn git_exec( &mut self, request: impl IntoRequest<GitExecRequest>, ) -> Result<Response<GitExecResponse>, Status>

Execute Git - Execute git command

Source

pub async fn register_debug_adapter( &mut self, request: impl IntoRequest<RegisterDebugAdapterRequest>, ) -> Result<Response<Empty>, Status>

Register Debug Adapter - Register debug adapter

Source

pub async fn start_debugging( &mut self, request: impl IntoRequest<StartDebuggingRequest>, ) -> Result<Response<StartDebuggingResponse>, Status>

Start Debugging - Start debug session

Source

pub async fn participate_in_save( &mut self, request: impl IntoRequest<ParticipateInSaveRequest>, ) -> Result<Response<ParticipateInSaveResponse>, Status>

Participate in Save - Extension participates in save

Source

pub async fn get_secret( &mut self, request: impl IntoRequest<GetSecretRequest>, ) -> Result<Response<GetSecretResponse>, Status>

Get Secret - Retrieve a secret from storage

Source

pub async fn store_secret( &mut self, request: impl IntoRequest<StoreSecretRequest>, ) -> Result<Response<Empty>, Status>

Store Secret - Store a secret in storage

Source

pub async fn delete_secret( &mut self, request: impl IntoRequest<DeleteSecretRequest>, ) -> Result<Response<Empty>, Status>

Delete Secret - Delete a secret from storage

Trait Implementations§

Source§

impl<T: Clone> Clone for CocoonServiceClient<T>

Source§

fn clone(&self) -> CocoonServiceClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for CocoonServiceClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for CocoonServiceClient<T>

§

impl<T> RefUnwindSafe for CocoonServiceClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for CocoonServiceClient<T>
where T: Send,

§

impl<T> Sync for CocoonServiceClient<T>
where T: Sync,

§

impl<T> Unpin for CocoonServiceClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for CocoonServiceClient<T>
where T: UnwindSafe,

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> DowncastSync for T
where T: Any + Send + Sync,

§

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

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further 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> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<T> UserEvent for T
where T: Debug + Clone + Send + 'static,