rustls::conn

Struct ConnectionCore

Source
pub(crate) struct ConnectionCore<Data> {
    pub(crate) state: Result<Box<dyn State<Data>>, Error>,
    pub(crate) data: Data,
    pub(crate) common_state: CommonState,
    pub(crate) hs_deframer: HandshakeDeframer,
    seen_consecutive_empty_fragments: u8,
}

Fields§

§state: Result<Box<dyn State<Data>>, Error>§data: Data§common_state: CommonState§hs_deframer: HandshakeDeframer§seen_consecutive_empty_fragments: u8

We limit consecutive empty fragments to avoid a route for the peer to send us significant but fruitless traffic.

Implementations§

Source§

impl<Data> ConnectionCore<Data>

Source

pub(crate) fn new( state: Box<dyn State<Data>>, data: Data, common_state: CommonState, ) -> Self

Source

pub(crate) fn process_new_packets( &mut self, deframer_buffer: &mut DeframerVecBuffer, sendable_plaintext: &mut ChunkVecBuffer, ) -> Result<IoState, Error>

Source

fn deframe<'b>( &mut self, state: Option<&dyn State<Data>>, buffer: &'b mut [u8], buffer_progress: &mut BufferProgress, ) -> Result<Option<InboundPlainMessage<'b>>, Error>

Pull a message out of the deframer and send any messages that need to be sent as a result.

Source

fn take_handshake_message<'b>( &mut self, buffer: &'b mut [u8], buffer_progress: &mut BufferProgress, ) -> Option<InboundPlainMessage<'b>>

Source

fn process_more_input<'b>( &mut self, state: Option<&dyn State<Data>>, buffer: &'b mut [u8], buffer_progress: &mut BufferProgress, ) -> Result<Option<InboundPlainMessage<'b>>, Error>

Source

fn handle_deframe_error( &mut self, error: Error, state: Option<&dyn State<Data>>, ) -> Error

Source

fn process_msg( &mut self, msg: InboundPlainMessage<'_>, state: Box<dyn State<Data>>, sendable_plaintext: Option<&mut ChunkVecBuffer>, ) -> Result<Box<dyn State<Data>>, Error>

Source

pub(crate) fn dangerous_extract_secrets(self) -> Result<ExtractedSecrets, Error>

Source

pub(crate) fn export_keying_material<T: AsMut<[u8]>>( &self, output: T, label: &[u8], context: Option<&[u8]>, ) -> Result<T, Error>

Source

fn maybe_refresh_traffic_keys(&mut self)

Trigger a refresh_traffic_keys if required by CommonState.

Source

fn refresh_traffic_keys(&mut self) -> Result<(), Error>

Source§

impl ConnectionCore<ClientConnectionData>

Source

pub(crate) fn for_client( config: Arc<ClientConfig>, name: ServerName<'static>, extra_exts: Vec<ClientExtension>, proto: Protocol, ) -> Result<Self, Error>

Source

pub(crate) fn is_early_data_accepted(&self) -> bool

Source§

impl ConnectionCore<ServerConnectionData>

Source

pub(crate) fn for_server( config: Arc<ServerConfig>, extra_exts: Vec<ServerExtension>, ) -> Result<Self, Error>

Source

pub(crate) fn reject_early_data(&mut self)

Source

pub(crate) fn get_sni_str(&self) -> Option<&str>

Trait Implementations§

Source§

impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>

Source§

fn from(core: ConnectionCore<Data>) -> Self

Converts to this type from the input type.
Source§

impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>

Source§

fn from(core: ConnectionCore<Data>) -> Self

Converts to this type from the input type.
Source§

impl<Data> From<ConnectionCore<Data>> for UnbufferedConnectionCommon<Data>

Source§

fn from(core: ConnectionCore<Data>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<Data> Freeze for ConnectionCore<Data>
where Data: Freeze,

§

impl<Data> !RefUnwindSafe for ConnectionCore<Data>

§

impl<Data> Send for ConnectionCore<Data>
where Data: Send,

§

impl<Data> Sync for ConnectionCore<Data>
where Data: Sync,

§

impl<Data> Unpin for ConnectionCore<Data>
where Data: Unpin,

§

impl<Data> !UnwindSafe for ConnectionCore<Data>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.