CombinedPacketHandler

Struct CombinedPacketHandler 

Source
pub struct CombinedPacketHandler<H1, H2>
where H1: HandlePacket, H2: HandlePacket,
{ /* private fields */ }
Expand description

A HandlePacket instance for combining two sub handlers

Using this struct could leverage the static generic dispatch for maximum performance when you want to use multiple handlers.

Note that in all packet handle functions, the first handler is executed before the second handler, and if the first handler returns an error, the whole function will directly return without executing the second handler.

Implementations§

Source§

impl<H1, H2> CombinedPacketHandler<H1, H2>
where H1: HandlePacket, H2: HandlePacket,

Source

pub fn new(handler1: H1, handler2: H2) -> Self

Create a new CombinedPacketHandler

Source

pub fn into_inner(self) -> (H1, H2)

Consume the handler and get the original two handler

Source

pub fn handler1(&self) -> &H1

Get shared reference to handler1

Source

pub fn handler1_mut(&mut self) -> &mut H1

Get unique reference to handler1

Source

pub fn handler2(&self) -> &H2

Get shared reference to handler2

Source

pub fn handler2_mut(&mut self) -> &mut H2

Get unique reference to handler2

Trait Implementations§

Source§

impl<H1, H2> HandlePacket for CombinedPacketHandler<H1, H2>
where H1: HandlePacket, H2: HandlePacket, CombinedError<H1, H2>: Error,

Source§

type Error = CombinedError<H1, H2>

Custom error type
Source§

fn at_decode_begin(&mut self) -> Result<(), Self::Error>

Callback at begin of decoding. Read more
Source§

fn on_short_tnt_packet( &mut self, context: &DecoderContext, packet_byte: NonZero<u8>, highest_bit: u32, ) -> Result<(), Self::Error>

Handle short TNT packet Read more
Source§

fn on_long_tnt_packet( &mut self, context: &DecoderContext, packet_bytes: NonZero<u64>, highest_bit: u32, ) -> Result<(), Self::Error>

Handle short TNT packet Read more
Source§

fn on_tip_packet( &mut self, context: &DecoderContext, ip_reconstruction_pattern: IpReconstructionPattern, ) -> Result<(), Self::Error>

Handle TIP packet
Source§

fn on_tip_pgd_packet( &mut self, context: &DecoderContext, ip_reconstruction_pattern: IpReconstructionPattern, ) -> Result<(), Self::Error>

Handle TIP.PGD packet
Source§

fn on_tip_pge_packet( &mut self, context: &DecoderContext, ip_reconstruction_pattern: IpReconstructionPattern, ) -> Result<(), Self::Error>

Handle TIP.PGE packet
Source§

fn on_fup_packet( &mut self, context: &DecoderContext, ip_reconstruction_pattern: IpReconstructionPattern, ) -> Result<(), Self::Error>

Handle FUP packet
Source§

fn on_pad_packet(&mut self, context: &DecoderContext) -> Result<(), Self::Error>

Handle PAD packet
Source§

fn on_cyc_packet( &mut self, context: &DecoderContext, cyc_packet: &[u8], ) -> Result<(), Self::Error>

Handle CYC packet Read more
Source§

fn on_mode_packet( &mut self, context: &DecoderContext, leaf_id: u8, mode: u8, ) -> Result<(), Self::Error>

Handle MODE packet Read more
Source§

fn on_mtc_packet( &mut self, context: &DecoderContext, ctc_payload: u8, ) -> Result<(), Self::Error>

Handle MTC packet Read more
Source§

fn on_tsc_packet( &mut self, context: &DecoderContext, tsc_value: u64, ) -> Result<(), Self::Error>

Handle TSC packet Read more
Source§

fn on_cbr_packet( &mut self, context: &DecoderContext, core_bus_ratio: u8, ) -> Result<(), Self::Error>

Handle CBR packet Read more
Source§

fn on_tma_packet( &mut self, context: &DecoderContext, ctc: u16, fast_counter: u8, fc8: bool, ) -> Result<(), Self::Error>

Handle TMA packet Read more
Source§

fn on_vmcs_packet( &mut self, context: &DecoderContext, vmcs_pointer: u64, ) -> Result<(), Self::Error>

Handle VMCS packet Read more
Source§

fn on_ovf_packet(&mut self, context: &DecoderContext) -> Result<(), Self::Error>

Handle OVF packet
Source§

fn on_psb_packet(&mut self, context: &DecoderContext) -> Result<(), Self::Error>

Handle PSB packet
Source§

fn on_psbend_packet( &mut self, context: &DecoderContext, ) -> Result<(), Self::Error>

Handle PSBEND packet
Source§

fn on_trace_stop_packet( &mut self, context: &DecoderContext, ) -> Result<(), Self::Error>

Handle TraceStop packet
Source§

fn on_pip_packet( &mut self, context: &DecoderContext, cr3: u64, rsvd_nr: bool, ) -> Result<(), Self::Error>

Handle PIP packet Read more
Source§

fn on_mnt_packet( &mut self, context: &DecoderContext, payload: u64, ) -> Result<(), Self::Error>

Handle MNT packet Read more
Source§

fn on_ptw_packet( &mut self, context: &DecoderContext, ip_bit: bool, payload: PtwPayload, ) -> Result<(), Self::Error>

Handle PTW packet Read more
Source§

fn on_exstop_packet( &mut self, context: &DecoderContext, ip_bit: bool, ) -> Result<(), Self::Error>

Handle EXSTOP packet Read more
Source§

fn on_mwait_packet( &mut self, context: &DecoderContext, mwait_hints: u8, ext: u8, ) -> Result<(), Self::Error>

Handle MWAIT packet Read more
Source§

fn on_pwre_packet( &mut self, context: &DecoderContext, hw: bool, resolved_thread_c_state: u8, resolved_thread_sub_c_state: u8, ) -> Result<(), Self::Error>

Handle PWRE packet Read more
Source§

fn on_pwrx_packet( &mut self, context: &DecoderContext, last_core_c_state: u8, deepest_core_c_state: u8, wake_reason: u8, ) -> Result<(), Self::Error>

Handle PWRX packet Read more
Source§

fn on_evd_packet( &mut self, context: &DecoderContext, type: u8, payload: u64, ) -> Result<(), Self::Error>

Handle EVD packet Read more
Source§

fn on_cfe_packet( &mut self, context: &DecoderContext, ip_bit: bool, type: u8, vector: u8, ) -> Result<(), Self::Error>

Handle CFE packet Read more
Source§

fn on_bbp_packet( &mut self, context: &DecoderContext, sz_bit: bool, type: u8, ) -> Result<(), Self::Error>

Handle BBP packet Read more
Source§

fn on_bep_packet( &mut self, context: &DecoderContext, ip_bit: bool, ) -> Result<(), Self::Error>

Handle BEP packet Read more
Source§

fn on_bip_packet( &mut self, context: &DecoderContext, id: u8, payload: &[u8], bbp_type: u8, ) -> Result<(), Self::Error>

Handle BIP packet Read more

Auto Trait Implementations§

§

impl<H1, H2> Freeze for CombinedPacketHandler<H1, H2>
where H1: Freeze, H2: Freeze,

§

impl<H1, H2> RefUnwindSafe for CombinedPacketHandler<H1, H2>

§

impl<H1, H2> Send for CombinedPacketHandler<H1, H2>
where H1: Send, H2: Send,

§

impl<H1, H2> Sync for CombinedPacketHandler<H1, H2>
where H1: Sync, H2: Sync,

§

impl<H1, H2> Unpin for CombinedPacketHandler<H1, H2>
where H1: Unpin, H2: Unpin,

§

impl<H1, H2> UnwindSafe for CombinedPacketHandler<H1, H2>
where H1: UnwindSafe, H2: UnwindSafe,

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.