pub struct AgentGroups {
pub groups: Vec<String>,
}Expand description
Value stored in the agent_groups KV bucket, keyed by pc_id. The
wrapper struct (instead of a bare Vec<String>) leaves room for
future per-PC metadata (membership timestamps, who-set-it audit, …)
without breaking the wire format.
Fields§
§groups: Vec<String>Sorted, de-duplicated group names. Producers should call
AgentGroups::new / AgentGroups::insert / AgentGroups::remove
to maintain those invariants; consumers can rely on them when
diffing two snapshots for “what changed since last KV update”.
Implementations§
Source§impl AgentGroups
impl AgentGroups
Sourcepub fn new<I, S>(groups: I) -> Self
pub fn new<I, S>(groups: I) -> Self
Construct from any iterator. Sorts + dedups so two callers that produce the same logical set get bit-identical JSON.
Sourcepub fn insert(&mut self, group: impl Into<String>) -> bool
pub fn insert(&mut self, group: impl Into<String>) -> bool
Insert a group. Returns true if the membership actually
changed (i.e. the group wasn’t already present). Keeps the
inner Vec sorted.
Sourcepub fn remove(&mut self, group: &str) -> bool
pub fn remove(&mut self, group: &str) -> bool
Remove a group. Returns true if the membership actually
changed (i.e. the group was present).
pub fn contains(&self, group: &str) -> bool
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, String>
Trait Implementations§
Source§impl Clone for AgentGroups
impl Clone for AgentGroups
Source§fn clone(&self) -> AgentGroups
fn clone(&self) -> AgentGroups
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentGroups
impl Debug for AgentGroups
Source§impl Default for AgentGroups
impl Default for AgentGroups
Source§fn default() -> AgentGroups
fn default() -> AgentGroups
Source§impl<'de> Deserialize<'de> for AgentGroups
impl<'de> Deserialize<'de> for AgentGroups
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>,
impl Eq for AgentGroups
Source§impl PartialEq for AgentGroups
impl PartialEq for AgentGroups
Source§fn eq(&self, other: &AgentGroups) -> bool
fn eq(&self, other: &AgentGroups) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentGroups
impl Serialize for AgentGroups
impl StructuralPartialEq for AgentGroups
Auto Trait Implementations§
impl Freeze for AgentGroups
impl RefUnwindSafe for AgentGroups
impl Send for AgentGroups
impl Sync for AgentGroups
impl Unpin for AgentGroups
impl UnsafeUnpin for AgentGroups
impl UnwindSafe for AgentGroups
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
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
key and return true if they are equal.