pub struct ToolState { /* private fields */ }Implementations§
Source§impl ToolState
impl ToolState
pub fn generation(&self) -> u64
pub fn with_generation(self, generation: u64) -> ToolState
Sourcepub fn tool_manifests(&self) -> Vec<ToolManifest>
pub fn tool_manifests(&self) -> Vec<ToolManifest>
Manifests for current Tool Catalog members. Orphaned and host-removed entries are excluded (non-membership) but kept in state for rebind.
pub fn get(&self, id: &ToolId) -> Option<&ToolStateEntry>
Sourcepub fn manifest_mut(&mut self, id: &ToolId) -> Option<&mut ToolManifest>
pub fn manifest_mut(&mut self, id: &ToolId) -> Option<&mut ToolManifest>
Edit a manifest in an explicit ToolRegistry::apply_state delta.
Automatic rebuilds replace stored manifests with their live versions, so this is not a persistent source-curation mechanism.
pub fn contains(&self, id: &ToolId) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn iter(&self) -> impl Iterator<Item = (&ToolId, &ToolStateEntry)>
Sourcepub fn set_membership(
&mut self,
id: &ToolId,
present: bool,
) -> Result<(), ReconfigureError>
pub fn set_membership( &mut self, id: &ToolId, present: bool, ) -> Result<(), ReconfigureError>
Toggle Tool Catalog membership for a tool. present == false removes
the tool from the catalog (non-membership) while keeping its state entry;
present == true restores membership.
Sourcepub fn remove(&mut self, id: &ToolId) -> Option<ToolStateEntry>
pub fn remove(&mut self, id: &ToolId) -> Option<ToolStateEntry>
Delete a tool in an explicit ToolRegistry::apply_state delta.
Deletion intentionally removes the entry for that delta only. Use
Self::set_membership for curation that must survive a rebuild from
live sources.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolState
impl<'de> Deserialize<'de> for ToolState
Source§fn deserialize<D>(
deserializer: D,
) -> Result<ToolState, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ToolState, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ToolState
impl Serialize for ToolState
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ToolState
impl RefUnwindSafe for ToolState
impl Send for ToolState
impl Sync for ToolState
impl Unpin for ToolState
impl UnsafeUnpin for ToolState
impl UnwindSafe for ToolState
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