pub struct InitializeBuild { /* private fields */ }Expand description
Like the language server protocol, the initialize request is sent as the first request from the client to the server. If the server receives a request or notification before the initialize request it should act as follows:
-
For a request the response should be an error with code: -32002. The message can be picked by the server.
-
Notifications should be dropped, except for the exit notification. This will allow the exit of a server without an initialize request.
Until the server has responded to the initialize request with an crate::InitializeBuildResult, the
client must not send any additional requests or notifications to the server.
Implementations§
Source§impl InitializeBuild
impl InitializeBuild
pub fn new<S: Into<String>>( display_name: S, version: S, bsp_version: S, root_uri: Url, capabilities: ClientCapabilities, data: Value, ) -> Self
pub fn new_simple<S: Into<String>>( display_name: S, version: S, bsp_version: S, root_uri: Url, capabilities: ClientCapabilities, ) -> Self
Sourcepub fn data(&self) -> Option<&Value>
pub fn data(&self) -> Option<&Value>
Get a reference to the bsp initialize build params’s data.
Sourcepub fn capabilities(&self) -> &ClientCapabilities
pub fn capabilities(&self) -> &ClientCapabilities
Get a reference to the bsp initialize build params’s capabilities.
Sourcepub fn set_capabilities(&mut self, capabilities: ClientCapabilities)
pub fn set_capabilities(&mut self, capabilities: ClientCapabilities)
Set the bsp initialize build params’s capabilities.
Sourcepub fn root_path(&self) -> PathBuf
pub fn root_path(&self) -> PathBuf
Get a reference to the bsp initialize build params’s root uri.
Sourcepub fn set_root_uri(&mut self, root_uri: Url)
pub fn set_root_uri(&mut self, root_uri: Url)
Set the bsp initialize build params’s root uri.
Sourcepub fn bsp_version(&self) -> &str
pub fn bsp_version(&self) -> &str
Get a reference to the bsp initialize build params’s bsp version.
Sourcepub fn set_bsp_version(&mut self, bsp_version: String)
pub fn set_bsp_version(&mut self, bsp_version: String)
Set the bsp initialize build params’s bsp version.
Sourcepub fn set_version(&mut self, version: String)
pub fn set_version(&mut self, version: String)
Set the bsp initialize build params’s version.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Get a reference to the bsp initialize build params’s display name.
Sourcepub fn set_display_name(&mut self, display_name: String)
pub fn set_display_name(&mut self, display_name: String)
Set the bsp initialize build params’s display name.
Trait Implementations§
Source§impl Clone for InitializeBuild
impl Clone for InitializeBuild
Source§fn clone(&self) -> InitializeBuild
fn clone(&self) -> InitializeBuild
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more