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>
impl<Data> ConnectionCore<Data>
pub(crate) fn new( state: Box<dyn State<Data>>, data: Data, common_state: CommonState, ) -> Self
pub(crate) fn process_new_packets( &mut self, deframer_buffer: &mut DeframerVecBuffer, sendable_plaintext: &mut ChunkVecBuffer, ) -> Result<IoState, Error>
Sourcefn deframe<'b>(
&mut self,
state: Option<&dyn State<Data>>,
buffer: &'b mut [u8],
buffer_progress: &mut BufferProgress,
) -> Result<Option<InboundPlainMessage<'b>>, Error>
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.
fn take_handshake_message<'b>( &mut self, buffer: &'b mut [u8], buffer_progress: &mut BufferProgress, ) -> Option<InboundPlainMessage<'b>>
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>
fn handle_deframe_error( &mut self, error: Error, state: Option<&dyn State<Data>>, ) -> Error
fn process_msg( &mut self, msg: InboundPlainMessage<'_>, state: Box<dyn State<Data>>, sendable_plaintext: Option<&mut ChunkVecBuffer>, ) -> Result<Box<dyn State<Data>>, Error>
pub(crate) fn dangerous_extract_secrets(self) -> Result<ExtractedSecrets, Error>
pub(crate) fn export_keying_material<T: AsMut<[u8]>>( &self, output: T, label: &[u8], context: Option<&[u8]>, ) -> Result<T, Error>
Sourcefn maybe_refresh_traffic_keys(&mut self)
fn maybe_refresh_traffic_keys(&mut self)
Trigger a refresh_traffic_keys
if required by CommonState
.
fn refresh_traffic_keys(&mut self) -> Result<(), Error>
Source§impl ConnectionCore<ClientConnectionData>
impl ConnectionCore<ClientConnectionData>
pub(crate) fn for_client( config: Arc<ClientConfig>, name: ServerName<'static>, extra_exts: Vec<ClientExtension>, proto: Protocol, ) -> Result<Self, Error>
pub(crate) fn is_early_data_accepted(&self) -> bool
Source§impl ConnectionCore<ServerConnectionData>
impl ConnectionCore<ServerConnectionData>
pub(crate) fn for_server( config: Arc<ServerConfig>, extra_exts: Vec<ServerExtension>, ) -> Result<Self, Error>
pub(crate) fn reject_early_data(&mut self)
pub(crate) fn get_sni_str(&self) -> Option<&str>
Trait Implementations§
Source§impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>
impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>
Source§fn from(core: ConnectionCore<Data>) -> Self
fn from(core: ConnectionCore<Data>) -> Self
Converts to this type from the input type.
Source§impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>
impl<Data> From<ConnectionCore<Data>> for ConnectionCommon<Data>
Source§fn from(core: ConnectionCore<Data>) -> Self
fn from(core: ConnectionCore<Data>) -> Self
Converts to this type from the input type.
Source§impl<Data> From<ConnectionCore<Data>> for UnbufferedConnectionCommon<Data>
impl<Data> From<ConnectionCore<Data>> for UnbufferedConnectionCommon<Data>
Source§fn from(core: ConnectionCore<Data>) -> Self
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> 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