pub struct ServerCommand(/* private fields */);Expand description
The non-blank executable name or path of an LSP server.
Deserializes from a TOML string and rejects a blank one at load time.
§Examples
use mcpls_core::config::ServerCommand;
let command = ServerCommand::new("rust-analyzer").unwrap();
assert_eq!(command, "rust-analyzer");
assert!(ServerCommand::new(" ").is_err());Implementations§
Source§impl ServerCommand
impl ServerCommand
Sourcepub const fn from_static(text: &'static str) -> Self
pub const fn from_static(text: &'static str) -> Self
Builds the value from a literal, checked at compile time when
evaluated in a const context.
Accepts only ASCII, non-blank literals, a subset of what
Self::new accepts.
§Panics
Panics if the literal is blank or not ASCII.
§Examples
use mcpls_core::config::ServerCommand;
const VALUE: ServerCommand = ServerCommand::from_static("value");
assert_eq!(VALUE.as_str(), "value");Sourcepub fn new(text: impl Into<String>) -> Result<Self, InvalidServerCommand>
pub fn new(text: impl Into<String>) -> Result<Self, InvalidServerCommand>
Builds the value from any string.
§Errors
Returns InvalidServerCommand if text is blank.
§Examples
use mcpls_core::config::ServerCommand;
assert!(ServerCommand::new("value").is_ok());
assert!(ServerCommand::new(" ").is_err());Trait Implementations§
Source§impl AsRef<OsStr> for ServerCommand
impl AsRef<OsStr> for ServerCommand
Source§impl AsRef<Path> for ServerCommand
impl AsRef<Path> for ServerCommand
Source§impl AsRef<str> for ServerCommand
impl AsRef<str> for ServerCommand
Source§impl Borrow<str> for ServerCommand
impl Borrow<str> for ServerCommand
Source§impl Clone for ServerCommand
impl Clone for ServerCommand
Source§impl Debug for ServerCommand
impl Debug for ServerCommand
Source§impl<'de> Deserialize<'de> for ServerCommand
impl<'de> Deserialize<'de> for ServerCommand
Source§fn 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
Source§impl Display for ServerCommand
impl Display for ServerCommand
impl Eq for ServerCommand
Source§impl From<ServerCommand> for String
impl From<ServerCommand> for String
Source§fn from(value: ServerCommand) -> Self
fn from(value: ServerCommand) -> Self
Converts to this type from the input type.
Source§impl From<ServerCommand> for LaunchCommand
impl From<ServerCommand> for LaunchCommand
Source§fn from(command: ServerCommand) -> Self
fn from(command: ServerCommand) -> Self
Converts to this type from the input type.
Source§impl FromStr for ServerCommand
impl FromStr for ServerCommand
Source§impl Hash for ServerCommand
impl Hash for ServerCommand
Source§impl PartialEq for ServerCommand
impl PartialEq for ServerCommand
Source§impl PartialEq<&str> for ServerCommand
impl PartialEq<&str> for ServerCommand
Source§impl PartialEq<str> for ServerCommand
impl PartialEq<str> for ServerCommand
Source§impl Serialize for ServerCommand
impl Serialize for ServerCommand
impl StructuralPartialEq for ServerCommand
Auto Trait Implementations§
impl Freeze for ServerCommand
impl RefUnwindSafe for ServerCommand
impl Send for ServerCommand
impl Sync for ServerCommand
impl Unpin for ServerCommand
impl UnsafeUnpin for ServerCommand
impl UnwindSafe for ServerCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.