pub struct ProjectTrustStore {
pub projects: BTreeMap<String, BTreeMap<String, String>>,
}Expand description
Persistent record of explicitly approved project-level MCP servers.
Fields§
§projects: BTreeMap<String, BTreeMap<String, String>>Implementations§
Source§impl ProjectTrustStore
impl ProjectTrustStore
Sourcepub fn load(path: &Path) -> Result<Self, McpConfigError>
pub fn load(path: &Path) -> Result<Self, McpConfigError>
Loads the trust store from path. Missing file means no trusted project servers.
Sourcepub fn save(&self, path: &Path) -> Result<(), McpConfigError>
pub fn save(&self, path: &Path) -> Result<(), McpConfigError>
Saves the trust store to path with mode 0600 on Unix.
Sourcepub fn is_trusted(
&self,
project_root: &Path,
server_name: &str,
config: &ServerConfig,
) -> Result<bool, McpConfigError>
pub fn is_trusted( &self, project_root: &Path, server_name: &str, config: &ServerConfig, ) -> Result<bool, McpConfigError>
Checks whether server_name in project_root is explicitly trusted for its current config.
Sourcepub fn trust(
&mut self,
project_root: &Path,
server_name: &str,
config: &ServerConfig,
) -> Result<(), McpConfigError>
pub fn trust( &mut self, project_root: &Path, server_name: &str, config: &ServerConfig, ) -> Result<(), McpConfigError>
Records explicit user approval for a project-level server’s current configuration.
Trait Implementations§
Source§impl Clone for ProjectTrustStore
impl Clone for ProjectTrustStore
Source§impl Debug for ProjectTrustStore
impl Debug for ProjectTrustStore
Source§impl Default for ProjectTrustStore
impl Default for ProjectTrustStore
Source§impl<'de> Deserialize<'de> for ProjectTrustStore
impl<'de> Deserialize<'de> for ProjectTrustStore
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
impl Eq for ProjectTrustStore
Source§impl PartialEq for ProjectTrustStore
impl PartialEq for ProjectTrustStore
Source§impl Serialize for ProjectTrustStore
impl Serialize for ProjectTrustStore
impl StructuralPartialEq for ProjectTrustStore
Auto Trait Implementations§
impl Forget for ProjectTrustStore
impl Freeze for ProjectTrustStore
impl Move for ProjectTrustStore
impl RefUnwindSafe for ProjectTrustStore
impl Send for ProjectTrustStore
impl Sync for ProjectTrustStore
impl Unpin for ProjectTrustStore
impl UnsafeUnpin for ProjectTrustStorewhere
*const LeafNode<String, BTreeMap<String, String>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, BTreeMap<String, String>)>>: UnsafeUnpin,
impl UnwindSafe for ProjectTrustStore
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.