pub struct Extension {
pub name: String,
pub details: Unparsed,
}
Expand description
Container for SSH agent protocol extension messages
This structure is sent as part of a Request::Extension
(SSH_AGENT_EXTENSION_RESPONSE
) message.
Described in draft-miller-ssh-agent-14 § 3.8.
Fields§
§name: String
Indicates the type of the extension message (as a UTF-8 string)
Extension names should be suffixed by the implementation domain as per RFC4251 § 4.2, e.g. “foo@example.com”
details: Unparsed
Extension-specific content
Implementations§
Source§impl Extension
impl Extension
Sourcepub fn new_message<T>(extension: T) -> Result<Self>where
T: MessageExtension + Encode,
pub fn new_message<T>(extension: T) -> Result<Self>where
T: MessageExtension + Encode,
Create a new Extension
from a MessageExtension
structure implementing ssh_encoding::Encode
Sourcepub fn parse_message<T>(&self) -> Result<Option<T>, <T as Decode>::Error>where
T: MessageExtension + Decode,
pub fn parse_message<T>(&self) -> Result<Option<T>, <T as Decode>::Error>where
T: MessageExtension + Decode,
Attempt to parse a an extension object into a
MessageExtension
structure
implementing ssh_encoding::Decode
.
If there is a mismatch between the extension name
and the MessageExtension::NAME
, this method
will return None
Sourcepub fn new_key_constraint<T>(extension: T) -> Result<Self>where
T: KeyConstraintExtension + Encode,
pub fn new_key_constraint<T>(extension: T) -> Result<Self>where
T: KeyConstraintExtension + Encode,
Create a new Extension
from a KeyConstraintExtension
structure implementing ssh_encoding::Encode
Sourcepub fn parse_key_constraint<T>(&self) -> Result<Option<T>, <T as Decode>::Error>where
T: KeyConstraintExtension + Decode,
pub fn parse_key_constraint<T>(&self) -> Result<Option<T>, <T as Decode>::Error>where
T: KeyConstraintExtension + Decode,
Attempt to parse a an extension object into a
KeyConstraintExtension
structure
implementing ssh_encoding::Decode
.
If there is a mismatch between the extension name
and the KeyConstraintExtension::NAME
, this method
will return None
Trait Implementations§
Source§impl Encode for Extension
impl Encode for Extension
Source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Writer
.Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.Source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix
set to Encode::encoded_len
.