Struct bsp_types::InitializeBuild
source · [−]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
sourceimpl 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
sourceimpl Clone for InitializeBuild
impl Clone for InitializeBuild
sourcefn clone(&self) -> InitializeBuild
fn clone(&self) -> InitializeBuild
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for InitializeBuild
impl Debug for InitializeBuild
sourceimpl<'de> Deserialize<'de> for InitializeBuild
impl<'de> Deserialize<'de> for InitializeBuild
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<InitializeBuild> for InitializeBuild
impl PartialEq<InitializeBuild> for InitializeBuild
sourcefn eq(&self, other: &InitializeBuild) -> bool
fn eq(&self, other: &InitializeBuild) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &InitializeBuild) -> bool
fn ne(&self, other: &InitializeBuild) -> bool
This method tests for !=.
sourceimpl Serialize for InitializeBuild
impl Serialize for InitializeBuild
impl Eq for InitializeBuild
impl StructuralEq for InitializeBuild
impl StructuralPartialEq for InitializeBuild
Auto Trait Implementations
impl RefUnwindSafe for InitializeBuild
impl Send for InitializeBuild
impl Sync for InitializeBuild
impl Unpin for InitializeBuild
impl UnwindSafe for InitializeBuild
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more