pub struct AgentDescriptor { /* private fields */ }Expand description
Describes an agent connecting to FEAGI.
Contains metadata information including manufacturer, agent name, version
All deserialization (JSON, etc.) goes through validation automatically.
Implementations§
Source§impl AgentDescriptor
impl AgentDescriptor
Sourcepub const MAX_MANUFACTURER_NAME_BYTE_COUNT: usize = 128
pub const MAX_MANUFACTURER_NAME_BYTE_COUNT: usize = 128
Maximum length in bytes for the manufacturer field
Sourcepub const MAX_AGENT_NAME_BYTE_COUNT: usize = 64
pub const MAX_AGENT_NAME_BYTE_COUNT: usize = 64
Maximum length in bytes for the agent name field
Sourcepub const SIZE_BYTES: usize
pub const SIZE_BYTES: usize
Total size in bytes when serialized to binary format
Sourcepub fn new(
manufacturer: &str,
agent_name: &str,
agent_version: u32,
) -> Result<Self, FeagiDataError>
pub fn new( manufacturer: &str, agent_name: &str, agent_version: u32, ) -> Result<Self, FeagiDataError>
Create a new AgentDescriptor with validation.
§Arguments
instance_id- Unique instance identifiermanufacturer- Manufacturer name (ASCII only, max 20 bytes)agent_name- Agent name (ASCII only, max 20 bytes)agent_version- Version number (must be non-zero)
§Errors
Returns an error if:
manufactureroragent_namecontain non-ASCII charactersmanufacturerexceeds 20 bytesagent_nameexceeds 20 bytesagent_versionis zero
Sourcepub fn manufacturer(&self) -> &str
pub fn manufacturer(&self) -> &str
Get the manufacturer name
Sourcepub fn agent_name(&self) -> &str
pub fn agent_name(&self) -> &str
Get the agent name
Sourcepub fn agent_version(&self) -> u32
pub fn agent_version(&self) -> u32
Get the agent version
Trait Implementations§
Source§impl Clone for AgentDescriptor
impl Clone for AgentDescriptor
Source§fn clone(&self) -> AgentDescriptor
fn clone(&self) -> AgentDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentDescriptor
impl Debug for AgentDescriptor
Source§impl<'de> Deserialize<'de> for AgentDescriptor
impl<'de> Deserialize<'de> for AgentDescriptor
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
Source§impl Hash for AgentDescriptor
impl Hash for AgentDescriptor
Source§impl PartialEq for AgentDescriptor
impl PartialEq for AgentDescriptor
Source§impl Serialize for AgentDescriptor
impl Serialize for AgentDescriptor
impl Eq for AgentDescriptor
impl StructuralPartialEq for AgentDescriptor
Auto Trait Implementations§
impl Freeze for AgentDescriptor
impl RefUnwindSafe for AgentDescriptor
impl Send for AgentDescriptor
impl Sync for AgentDescriptor
impl Unpin for AgentDescriptor
impl UnsafeUnpin for AgentDescriptor
impl UnwindSafe for AgentDescriptor
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more