Skip to content

Support of f64 for parser.try_parse #94

Answered by heestree
heestree asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @daladim yes, you're right. I tested f32 and it worked!. Thanks.

In parser.rs

impl_try_parse_primitive!(f32);
impl_try_parse_primitive!(f64);

My codes:

if schema.provider_name() == "Microsoft-Windows-Dwm-Core" {
    if schema.task_name() == "ETWGUID_DIRTY_ADDRECT" {
        if schema.opcode_name() == "Info " {
            let parser = Parser::create(record, &schema);
            let left: Option<f32> = parser.try_parse("left").ok();
            if left.is_some() {
                dbg!(left);
            }
        } else {
            dbg!(schema.opcode_name());
        }
    }
}

output

left = Some(
    1030.0,
)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by heestree
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants