pub enum WorkspaceTrust {
Trusted,
Untrusted(ServerAllowlist),
}Expand description
Whether the analyzed workspace is trusted to be handed to language servers.
Distinct from ProjectConfigTrust, which
governs only a project-local ./mcpls.toml and defaults to untrusted.
This value defaults to Trusted, the behavior of every
earlier release. It is never read from a config file: consent to start a
server comes from the command line of the user who launches mcpls, so a
planted mcpls.toml cannot grant it.
Untrusted mode is not a sandbox. A server the user allows still runs the workspace code it would run in a trusted workspace.
§Examples
use mcpls_core::config::{ServerId, WorkspaceTrust};
let rust = ServerId::from_static("rust");
assert!(WorkspaceTrust::default().allows(&rust));
let untrusted = WorkspaceTrust::untrusted([rust.clone()]);
assert!(untrusted.allows(&rust));
assert!(!untrusted.allows(&ServerId::from_static("python")));Variants§
Trusted
Every applicable server is started.
Untrusted(ServerAllowlist)
Only the servers in the allowlist are started.
Implementations§
Trait Implementations§
Source§impl Clone for WorkspaceTrust
impl Clone for WorkspaceTrust
Source§impl Debug for WorkspaceTrust
impl Debug for WorkspaceTrust
Source§impl Default for WorkspaceTrust
impl Default for WorkspaceTrust
impl Eq for WorkspaceTrust
Source§impl PartialEq for WorkspaceTrust
impl PartialEq for WorkspaceTrust
impl StructuralPartialEq for WorkspaceTrust
Auto Trait Implementations§
impl Freeze for WorkspaceTrust
impl RefUnwindSafe for WorkspaceTrust
impl Send for WorkspaceTrust
impl Sync for WorkspaceTrust
impl Unpin for WorkspaceTrust
impl UnsafeUnpin for WorkspaceTrust
impl UnwindSafe for WorkspaceTrust
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,
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.