pub struct AgentId(/* private fields */);Expand description
Unique identifier for a solti agent instance.
Represents the identity of a running agent process. The caller is responsible for providing a meaningful ID (e.g. UUID, hostname, pod name).
use solti_model::AgentId;
// From a UUID
let id = AgentId::new("550e8400-e29b-41d4-a716-446655440000");
assert_eq!(id.as_str(), "550e8400-e29b-41d4-a716-446655440000");
// From a Kubernetes pod name
let id: AgentId = "worker-pod-7b9f4".into();
assert_eq!(format!("{id}"), "worker-pod-7b9f4");Implementations§
Source§impl AgentId
impl AgentId
Sourcepub fn validate_format(&self) -> Result<(), ModelError>
pub fn validate_format(&self) -> Result<(), ModelError>
Validate that the agent id is safe to use across the SDK and the wire protocol.
See [validate_identity] for the exact rules.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentId
impl<'de> Deserialize<'de> for AgentId
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for AgentId
impl Ord for AgentId
Source§impl PartialOrd for AgentId
impl PartialOrd for AgentId
impl Eq for AgentId
impl StructuralPartialEq for AgentId
Auto Trait Implementations§
impl Freeze for AgentId
impl RefUnwindSafe for AgentId
impl Send for AgentId
impl Sync for AgentId
impl Unpin for AgentId
impl UnsafeUnpin for AgentId
impl UnwindSafe for AgentId
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