[][src]Trait rustls::internal::msgs::codec::Codec

pub trait Codec: Debug + Sized {
    fn encode(&self, bytes: &mut Vec<u8>);
fn read(_: &mut Reader) -> Option<Self>; fn get_encoding(&self) -> Vec<u8> { ... }
fn read_bytes(bytes: &[u8]) -> Option<Self> { ... } }

Things we can encode and read from a Reader.

Required methods

fn encode(&self, bytes: &mut Vec<u8>)

Encode yourself by appending onto bytes.

fn read(_: &mut Reader) -> Option<Self>

Decode yourself by fiddling with the Reader. Return Some if it worked, None if not.

Loading content...

Provided methods

fn get_encoding(&self) -> Vec<u8>

Convenience function to get the results of encode().

fn read_bytes(bytes: &[u8]) -> Option<Self>

Read one of these from the front of bytes and return it.

Loading content...

Implementations on Foreign Types

impl Codec for u8
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for u16
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for u32
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for u64
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

Loading content...

Implementors

impl Codec for CipherSuite
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ProtocolVersion
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for SignatureScheme
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for AlertDescription
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for AlertLevel
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateStatusType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientCertificateType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for Compression
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ContentType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ECCurveType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ECPointFormat
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ExtensionType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HandshakeType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HashAlgorithm
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HeartbeatMessageType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HeartbeatMode
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for KeyUpdateRequest
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NamedCurve
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NamedGroup
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PSKKeyExchangeMode
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerNameType
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for SignatureAlgorithm
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertReqExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateStatusRequest
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HelloRetryExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NewSessionTicketExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerExtension
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerKeyExchangePayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for AlertMessagePayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for Payload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PayloadU16
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PayloadU24
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PayloadU8
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ChangeCipherSpecPayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for u24
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateEntry
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificatePayloadTLS13
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateRequestPayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateRequestPayloadTLS13
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateStatus
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientECDHParams
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientHelloPayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for DigitallySignedStruct
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ECDHEServerKeyExchange
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ECParameters
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HandshakeMessagePayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for HelloRetryRequest
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for KeyShareEntry
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NewSessionTicketPayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NewSessionTicketPayloadTLS13
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for OCSPCertificateStatusRequest
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PresharedKeyIdentity
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PresharedKeyOffer
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for Random
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerECDHParams
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerHelloPayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerName
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for SessionID
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for Message
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientSessionKey
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientSessionValue
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerSessionValue
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for Certificate
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertReqExtensions
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificateExtensions
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for CertificatePayload
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ClientCertificateTypes
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ECPointFormatList
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for EncryptedExtensions
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for KeyShareEntries
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NamedGroups
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for NewSessionTicketExtensions
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PSKKeyExchangeModes
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for PresharedKeyIdentities
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ProtocolVersions
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for ServerNameRequest
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for SupportedSignatureSchemes
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for VecU16OfPayloadU16
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

impl Codec for VecU16OfPayloadU8
[src]

fn get_encoding(&self) -> Vec<u8>
[src]

fn read_bytes(bytes: &[u8]) -> Option<Self>
[src]

Loading content...