11// Certain casts are required only on Windows. Inform Clippy to ignore them.
22#![ allow( clippy:: unnecessary_cast) ]
33
4- use crate :: error:: { PtError , PtErrorCode } ;
54use bitflags:: bitflags;
65use libipt_sys:: {
76 pt_status_flag_pts_eos, pt_status_flag_pts_event_pending, pt_status_flag_pts_ip_suppressed,
@@ -11,29 +10,16 @@ bitflags! {
1110 /// Status flags for various IntelPT actions
1211 #[ derive( Debug , Clone , Copy ) ]
1312 pub struct Status : u32 {
14- /// There is no more trace data available.
15- const EOS = pt_status_flag_pts_eos as u32 ;
1613 /// There is an event pending.
1714 const EVENT_PENDING = pt_status_flag_pts_event_pending as u32 ;
1815 /// The address has been suppressed.
1916 const IP_SUPRESSED = pt_status_flag_pts_ip_suppressed as u32 ;
17+ /// There is no more trace data available.
18+ const EOS = pt_status_flag_pts_eos as u32 ;
2019 }
2120}
2221
2322impl Status {
24- pub ( crate ) fn from_bits_or_pterror ( pt_status : u32 ) -> Result < Self , PtError > {
25- Status :: from_bits ( pt_status) . ok_or ( PtError :: new (
26- PtErrorCode :: Internal ,
27- "Unknown state returned by libipt, failed to convert to Status" ,
28- ) )
29- }
30-
31- /// There is no more trace data available.
32- #[ must_use]
33- pub const fn eos ( & self ) -> bool {
34- self . contains ( Status :: EOS )
35- }
36-
3723 /// There is an event pending.
3824 #[ must_use]
3925 pub const fn event_pending ( & self ) -> bool {
@@ -45,4 +31,10 @@ impl Status {
4531 pub const fn ip_supressed ( & self ) -> bool {
4632 self . contains ( Status :: IP_SUPRESSED )
4733 }
34+
35+ /// There is no more trace data available.
36+ #[ must_use]
37+ pub const fn eos ( & self ) -> bool {
38+ self . contains ( Status :: EOS )
39+ }
4840}
0 commit comments