@@ -217,7 +217,6 @@ pub mod tracing {
217217}
218218pub mod builder {
219219 use super :: * ;
220- pub use s2n_quic_core:: event:: builder:: SocketAddress ;
221220 #[ derive( Clone , Debug ) ]
222221 pub struct ConnectionMeta {
223222 pub id : u64 ,
@@ -323,58 +322,6 @@ pub mod builder {
323322 }
324323 }
325324}
326- pub mod supervisor {
327- #![ doc = r" This module contains the `supervisor::Outcome` and `supervisor::Context` for use" ]
328- # and" ]
329- #" ]
330- #![ doc = r" on a Subscriber." ]
331- use crate :: {
332- application,
333- event:: { builder:: SocketAddress , IntoEvent } ,
334- } ;
335- #[ non_exhaustive]
336- #[ derive( Clone , Debug , Eq , PartialEq ) ]
337- pub enum Outcome {
338- #[ doc = r" Allow the connection to remain open" ]
339- Continue ,
340- #[ doc = r" Close the connection and notify the peer" ]
341- Close { error_code : application:: Error } ,
342- #[ doc = r" Close the connection without notifying the peer" ]
343- ImmediateClose { reason : & ' static str } ,
344- }
345- impl Default for Outcome {
346- fn default ( ) -> Self {
347- Self :: Continue
348- }
349- }
350- #[ non_exhaustive]
351- #[ derive( Debug ) ]
352- pub struct Context < ' a > {
353- #[ doc = r" Number of handshakes that have begun but not completed" ]
354- pub inflight_handshakes : usize ,
355- #[ doc = r" Number of open connections" ]
356- pub connection_count : usize ,
357- #[ doc = r" The address of the peer" ]
358- pub remote_address : SocketAddress < ' a > ,
359- #[ doc = r" True if the connection is in the handshake state, false otherwise" ]
360- pub is_handshaking : bool ,
361- }
362- impl < ' a > Context < ' a > {
363- pub fn new (
364- inflight_handshakes : usize ,
365- connection_count : usize ,
366- remote_address : & ' a crate :: inet:: SocketAddress ,
367- is_handshaking : bool ,
368- ) -> Self {
369- Self {
370- inflight_handshakes,
371- connection_count,
372- remote_address : remote_address. into_event ( ) ,
373- is_handshaking,
374- }
375- }
376- }
377- }
378325pub use traits:: * ;
379326mod traits {
380327 use super :: * ;
@@ -432,40 +379,6 @@ mod traits {
432379 meta : & api:: ConnectionMeta ,
433380 info : & api:: ConnectionInfo ,
434381 ) -> Self :: ConnectionContext ;
435- #[ doc = r" The period at which `on_supervisor_timeout` is called" ]
436- #[ doc = r"" ]
437- #[ doc = r" If multiple `event::Subscriber`s are composed together, the minimum `supervisor_timeout`" ]
438- #[ doc = r" across all `event::Subscriber`s will be used." ]
439- #[ doc = r"" ]
440- #[ doc = r" If the `supervisor_timeout()` is `None` across all `event::Subscriber`s, connection supervision" ]
441- #[ doc = r" will cease for the remaining lifetime of the connection and `on_supervisor_timeout` will no longer" ]
442- #[ doc = r" be called." ]
443- #[ doc = r"" ]
444- #[ doc = r" It is recommended to avoid setting this value less than ~100ms, as short durations" ]
445- #[ doc = r" may lead to higher CPU utilization." ]
446- #[ allow( unused_variables) ]
447- fn supervisor_timeout (
448- & mut self ,
449- conn_context : & mut Self :: ConnectionContext ,
450- meta : & api:: ConnectionMeta ,
451- context : & supervisor:: Context ,
452- ) -> Option < Duration > {
453- None
454- }
455- #[ doc = r" Called for each `supervisor_timeout` to determine any action to take on the connection based on the `supervisor::Outcome`" ]
456- #[ doc = r"" ]
457- #[ doc = r" If multiple `event::Subscriber`s are composed together, the minimum `supervisor_timeout`" ]
458- #[ doc = r" across all `event::Subscriber`s will be used, and thus `on_supervisor_timeout` may be called" ]
459- #[ doc = r" earlier than the `supervisor_timeout` for a given `event::Subscriber` implementation." ]
460- #[ allow( unused_variables) ]
461- fn on_supervisor_timeout (
462- & mut self ,
463- conn_context : & mut Self :: ConnectionContext ,
464- meta : & api:: ConnectionMeta ,
465- context : & supervisor:: Context ,
466- ) -> supervisor:: Outcome {
467- supervisor:: Outcome :: default ( )
468- }
469382 #[ doc = "Called when the `ByteArrayEvent` event is triggered" ]
470383 #[ inline]
471384 fn on_byte_array_event (
@@ -551,50 +464,6 @@ mod traits {
551464 )
552465 }
553466 #[ inline]
554- fn supervisor_timeout (
555- & mut self ,
556- conn_context : & mut Self :: ConnectionContext ,
557- meta : & api:: ConnectionMeta ,
558- context : & supervisor:: Context ,
559- ) -> Option < Duration > {
560- let timeout_a = self
561- . 0
562- . supervisor_timeout ( & mut conn_context. 0 , meta, context) ;
563- let timeout_b = self
564- . 1
565- . supervisor_timeout ( & mut conn_context. 1 , meta, context) ;
566- match ( timeout_a, timeout_b) {
567- ( None , None ) => None ,
568- ( None , Some ( timeout) ) | ( Some ( timeout) , None ) => Some ( timeout) ,
569- ( Some ( a) , Some ( b) ) => Some ( a. min ( b) ) ,
570- }
571- }
572- #[ inline]
573- fn on_supervisor_timeout (
574- & mut self ,
575- conn_context : & mut Self :: ConnectionContext ,
576- meta : & api:: ConnectionMeta ,
577- context : & supervisor:: Context ,
578- ) -> supervisor:: Outcome {
579- let outcome_a = self
580- . 0
581- . on_supervisor_timeout ( & mut conn_context. 0 , meta, context) ;
582- let outcome_b = self
583- . 1
584- . on_supervisor_timeout ( & mut conn_context. 1 , meta, context) ;
585- match ( outcome_a, outcome_b) {
586- ( supervisor:: Outcome :: ImmediateClose { reason } , _)
587- | ( _, supervisor:: Outcome :: ImmediateClose { reason } ) => {
588- supervisor:: Outcome :: ImmediateClose { reason }
589- }
590- ( supervisor:: Outcome :: Close { error_code } , _)
591- | ( _, supervisor:: Outcome :: Close { error_code } ) => {
592- supervisor:: Outcome :: Close { error_code }
593- }
594- _ => supervisor:: Outcome :: Continue ,
595- }
596- }
597- #[ inline]
598467 fn on_byte_array_event (
599468 & mut self ,
600469 context : & mut Self :: ConnectionContext ,
0 commit comments