pub struct Capabilities {
pub version: String,
pub agent_id: String,
pub agent_type: String,
pub compression: CompressionCaps,
pub security: SecurityCaps,
pub extensions: HashMap<String, String>,
}Expand description
Full agent capabilities
Fields§
§version: StringProtocol version
agent_id: StringAgent identifier
agent_type: StringAgent type/name
compression: CompressionCapsCompression capabilities
security: SecurityCapsSecurity capabilities
extensions: HashMap<String, String>Custom extensions (key-value pairs)
Implementations§
Source§impl Capabilities
impl Capabilities
Sourcepub fn with_compression(self, caps: CompressionCaps) -> Self
pub fn with_compression(self, caps: CompressionCaps) -> Self
Add compression capabilities
Sourcepub fn with_security(self, caps: SecurityCaps) -> Self
pub fn with_security(self, caps: SecurityCaps) -> Self
Add security capabilities
Sourcepub fn with_extension(self, key: &str, value: &str) -> Self
pub fn with_extension(self, key: &str, value: &str) -> Self
Add extension
Sourcepub fn is_compatible(&self, other: &Capabilities) -> bool
pub fn is_compatible(&self, other: &Capabilities) -> bool
Check version compatibility
Sourcepub fn negotiate(&self, peer: &Capabilities) -> Option<NegotiatedCaps>
pub fn negotiate(&self, peer: &Capabilities) -> Option<NegotiatedCaps>
Negotiate capabilities with peer
Trait Implementations§
Source§impl Clone for Capabilities
impl Clone for Capabilities
Source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
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 Capabilities
impl Debug for Capabilities
Source§impl Default for Capabilities
impl Default for Capabilities
Source§impl<'de> Deserialize<'de> for Capabilities
impl<'de> Deserialize<'de> for Capabilities
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
Auto Trait Implementations§
impl Freeze for Capabilities
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnwindSafe for Capabilities
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