How can I impl from_u8 for MyStruct, the compiler tells that "cannot infer an appropriate lifetime for lifetime parameter 'a due to conflicting requirements".
Only if you do something like owning the data instead. The trait function signature as-is says "I can make Self out of a slice with an arbitrary lifetime".